Help Understanding PStats

I’ve been getting framerates of about 30-35 FPS recently, with seemingly very little going on in my program, so I decided it was time for some optimization. Unfortunately, I am not sure how to interpret much of what PStats is telling me. I’m assuming it’s intuitive - for example, I assume that if my graphics memory is reading 2.3 MB, then that’s fine; and I assume that if frame time is 63ms in Graph A and 9 ms in Graph B, there is more of a problem in the aspects Graph A deals with (whereas more Hz is better than less Hz). Basically, whenever the graphs are low, that’s good, and when they’re way up, that’s bad - right?

That said, I’m not sure what all the names actually mean, and there’s no list on the PStats page in the manual. For example, I am getting 60-65 ms frame speed / 30-35 Hz in the “Wait” collector, almost all of the work being something called “Thread Block” (in contrast, I’m getting 8-10ms and 110-140 Hz in “App Time”, and almost everything else seems to have very low graphs, except collisions and generate text). I don’t know what Thread Block is, but it seems to be causing problems.

So what I’m wondering is this: is there a resource somewhere that tells me, as though I were a newbie (which I am), what sort of operations are picked up by what collectors, and correspondingly, indirectly help me figure out what I need to change in order to improve performance? Also, more immediately, what is Thread Block, and how can I get it back in line? I’d much appreciate any advice you can give! :slight_smile:

EDIT: I’ve looked around the forums and found that I might need to change some settings in my Config file, but when I open the Config.prc file, I don’t see the settings at all. I am using Panda3D-1.7.0 - is it maybe somewhere else in my version? Also, from the sounds of it, changing these settings might ruin my overall PC performance - isn’t there another way? This is the thread where I saw these settings:

[PStats, perfomance and Wait)

“Thread Block” is your Panda process waiting for other things on the system to run. In general, it will go down as your process uses more resources–that is, as you require more computation, your process will block less often, and you will still get about 20-30 fps for more work.

So, it’s only an issue if you really do want to achieve 60 fps when you are rendering very little. But in that case, you probably don’t mind that the other processes in your computer aren’t being as responsive. So go ahead and add the config settings referenced in the other thread; you probably won’t notice any problems.


Cool, thanks; so my performance should improve when I do more in my program, then. Is that right? For some reason, when I have 2 units in the test program, Thread Block is under control and FPS is around 50-60, but when I have 3, FPS drops to 30-40 and Thread Block is all over the place, with no other readings changed. I guess there’s like a critical point, like the worst amount of code - too much to run easily, but not enough to overcome Thread Blocking.

What about pass1 under ctrav under collisions? Is that just anything colliding at all? I’ve added a larger map and a couple of units to my program, hoping this would reduce the Thread Block problem, and suddenly I am getting FPS between 5 and 15, and massive collisions->ctrav->pass1 readings. I’ve only got 6 actors and their colliders sitting around the scene, so I can’t imagine where all that colliding is coming from. The manual section on collisions and performance is incomplete; is there some way to reduce the amount of collision work, similar to the rigid body combiner?

Even when I remove all but 2 units, I still only get around 30 FPS, which means, I guess, that the large map is also a problem - though since the number of colliding objects is the same, I don’t understand this. I am also getting quite a bit of render_frame, though nowhere near the collision work going on. All other readings seem to be rather normal.

pass1 is normal collisions. If it’s big, it means your collisions are expensive; maybe you’re colliding with too many things.

Note that your frame rate will be constrained to a harmonic of 60fps (that is, 60, 30, 20, 15, 12, and so on) unless you disable video sync in your Config.prc file:

sync-video 0

Also note that “thread block” is sometimes increased when you are running PStats itself, because PStats competes for your CPU.