Questions about the profilethinkers CCMD

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!
Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
D2JK
Posts: 545
Joined: Sat Aug 30, 2014 8:21 am

Questions about the profilethinkers CCMD

Post by D2JK »

I've been testing the profilethinkers console command I was pointed to, and was able to fix a few performance hogging oversights on my part.

I'm assuming it takes the measurements during a single tic immediately following the execution of the command. If correct, this poses a bit of a challenge in the following cases:

1) If I have some randomization written in the actor's functionality, which alters the CPU usage by the actor, the readings will fluctuate on subsequent executions. For example, average 0.002500 ms / actor on the first try, 0.003100 ms on second, 0.002120 ms on third, and so on. I suppose there is no way to take an averaged measurement over, say, 10 or 35 tics?

2) I know this is a rather broad question, and hard to answer comprehensively, but how would you catch some random CPU-intensive event during the play, using either profilethinkers or something else? Is the only option to simply make an educated guess on what might be the cause, and then for example, explicitly setting up a test where the event happens immediately on firing of a test weapon, and catching it by binding "profilethinkers; +attack" into a (keyboard) key?

I don't mean to appear too demanding. :D I certainly appreciate and consider the feature very useful even without the above possibilities.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49252
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: Questions about the profilethinkers CCMD

Post by Graf Zahl »

Normally the intervals for a single thinker are too short for reliable measurements. Where this gets useful is to see if some single class is adding up to too much, all actors of this class combined. And once you start having 100 or 200 actors of a given type, these fluctuations will even themselves out, unless you synchronize the 'random' behavior.

Return to “Scripting”