I played a bit with small engine optimizations today.
The GitHub - michaliskambi/many-cubes with 10 thousand cubes now works at 16.4 FPS (was at 9-10 FPS this morning). This is still a TODO naturally, 16 FPS is not satisfactory, but it’s a significant increase that may positively affect more use-cases. It means that new code executes in 0.579
fraction of the old one ((60 / 16.4) / (60 / 9.5)
), so that’s not bad progress
Or, to measure in the other way (“how much you can now increase NumCubes
while keeping reasonable FPS”):
- 1k, 2k, 3k cubes now run at 60 FPS
- 4k cubes now run at 38 FPS
- with 5k cubes you now have 30 FPS, so on the fence of “playable”.
These measurements of course are specific to my system,
- ~5 years old mid-range laptop with Nvidia ( NVIDIA GeForce RTX 3050 Ti Laptop GPU/PCIe/SSE2 )
- Linux x86_64
- Tested with FPC 3.2.2 and recent FPC 3.3.1 (out of curiosity, I tested whether FPC version affects performance in a noticeable way; it doesn’t, at least not in this testcase).
More optimizations in the engine I planned of course, so I will keep returning to this testcase and see how far can we push it without introducing game-specific optimizations mentioned in this thread and in README (so the demo deliberately uses TCastleBox
is most simple way, doesn’t try to use TCastleTransformReference
, LODs, everything is in frustum etc.)