Hello
Following on this thread: https://forum.xojo.com/45636-add-on-appgamekit-game-engine
I really want to get this work. And I’m bothered by the poor performance of image loading.
So I made a testcase:
I made 297 images, generated by the game engine I’m using. I also made a Xojo project that does a few things. Just fire the Xojo project up, select the folder where the images are, and it will start loading the files and do some counting and FPS calculation.
Basicly, I set up a timer on 16ms, about 60FPS, and load a new image on every action of that timer.
When I load the images from my SSD, I get about 23,5 FPS
When I load the images from my RAMDisk, I get about 25.5 FPS
Ok, there could be an explanation for that: It’s not the file loading that is slow, it’s the parsing that is slow. Perfectly possible, right? And who even runs 25 images per second, right? That’s not bad.
This could be, but there are 2 main problems:
- The images are generated (so, written, not read, should be slower) at about 120 FPS by an interpreted language.
- If you enable profiling, you can see that the timer only takes 1.6 ms to do it’s work.
But, but, I only get 23.5 FPS, so my timer isn’t fired every 16ms, it’s fired every 42.5 ms. That is a huge difference. That means my timer is waiting over 40ms on every call, and the profiler doesn’t give me any clue.
Do you guys have any clue?
You can download the project and images here: Imageloader.zip
If you have some time, can you fire it up, enable profiling, and push the Quit button after a few seconds?
There must be a simple explanation, but I’m scratching my head.
Thanks a bunch!