[osg-users] Would someone be willing to help me diagnose a performance issue?
knarf.navillus at gmail.com
Tue Nov 10 13:26:17 PST 2009
Thanks for all of your help and suggestions, people.
My plan for the last hour or so has been to first follow Philip's suggestion to see if I can get the Quick App to start behaving like the Slow App. My first step toward that goal was to replicate that 'object cache' by loading all 52 objects, adding them to the scene graph, each with their node masks zero'ed out. Then, for the three objects I actually want to display, I add them again separately.
It turns out that this had little effect on frame rate. The Quick App is still quick. Although I still find Frederic's suggestion helpful and I plan on implementing it later, it doesn't look like it will affect the frame rate much, which is what I'm after at this point.
So for my next step, I forced the Quick App to use the SingleThreaded model, which is the one that the Slow App uses. This actually seemed to give me a slight performance boost! Probably because, as Frederick mentioned, I only need a single thread for one display window (which is what I have) and so if anything, changing to SingleThreaded sped things up a bit, perhaps by getting rid of the overhead of managing multiple threads.
So, the culprit is neither the 'object cache' nor the threading model. I will have to keep plugging ahead I guess.
One difference I did notice, though, is that the numbers in the Camera stats window are still much, much higher in the Slow App than either versions of the Quick App.
Quick App (without Object Cache)
Quick App (with Object Cache)
I'm not sure exactly what these numbers mean. I thought that perhaps they referred to the total number of objects in the scene graph, whether visible or invisible, and whether or not they are in the viewing frustum. However, I noticed that the numbers change slightly depending on where I place the camera (therefore, I tried to place the camera in the same position for each of the data samples above to get the most comparable results). Also, if that were the case, then Quick App (with Object Cache) should have numbers comparable to Slow App -- they both have the exact same objects loaded and attached to the scene graph. However, both versions of the Quick App have similar numbers, while the Slow App numbers are way, way higher.
If anyone can help explain what these stats actually refer to, I think I may be able to track this problem down.
Read this topic online here:
More information about the osg-users