I’ve been working on an SDL1.2 project for a few months now, but I’ve been playing around with SDL2 the last couple days and I really like it—however, I’m a little confused as to whether the rendering is supposed to be considerably faster, or at least less CPU intensive.
I haven’t done very rigorous benchmarking, but here’s what I’ve seen (both programs locked to 60FPS):
SDL1.2: ~6,000 blits per frame, with ~4-6% CPU usage, inside my actual project
SDL2.0: ~6,000 render calls per frame, ~3-5% CPU usage, inside a project that does nothing else (i.e. no game logic)
Also, in that SDL2 program I’ve noticed that my GPU usage is often 0%, with sections of ~5-10% usage every couple of seconds (compared to a constant 0% GPU load before running the program). As I increase the number of RenderCopy calls per frame, GPU usage stays about the same while CPU usage increases a little less than linearly; to be honest, I’m not entirely convinced the program is using the GPU for rendering at all.
So I guess my questions are:
- Do these rendering speeds seem typical?
- Should the CPU be such a tight bottleneck for SDL2 rendering?
- Are these GPU load patterns normal?