Jump to content

Profiling mod


iWitch

Recommended Posts

As i understand there something like this for chrome version. Or it will work for steam too?

Is it possible to see how much time wasted on calling functions, wasted memory etc?

Somebody have such experience?

 

I made some custom widget for temperature monitoring and was surprised how often OnUpdate was called if StartUpdating() called.

 

i reduced useless callings when percent/value isnt changed much, but health and sanity indicators have same model of updating. Thats scary me :)

 

So want to know maybe it reality its cheap operation (in vanilla number showing only when mouse over indicator so its not problem), but mine shows value in any time and first time i saw crazy amount of updates :)

Link to comment
Share on other sites

As i understand there something like this for chrome version. Or it will work for steam too?

Is it possible to see how much time wasted on calling functions, wasted memory etc?

Somebody have such experience?

I haven't used it, but take a look at profiler.lua. It's well documented in the comments at the beginning of the file. But don't stress too much on premature optimisation, that's many a programmer's downfall :razz:.

I made some custom widget for temperature monitoring and was surprised how often OnUpdate was called if StartUpdating() called.

 

i reduced useless callings when percent/value isnt changed much, but health and sanity indicators have same model of updating. Thats scary me :-)

 

So want to know maybe it reality its cheap operation (in vanilla number showing only when mouse over indicator so its not problem), but mine shows value in any time and first time i saw crazy amount of updates :-)

Yes, OnUpdate methods are called very often. Every frame, if I'm not mistaken. That's why components with more expensive update logic use a custom update task via self.inst:DoPeriodicTask() or similar.

Link to comment
Share on other sites

and one more question :-)

if i change some standart component by adding few variables and OnLoad/OnSave to handle it

will it broke game save if mod will be disabled or deleted in future?

or next save (on exit or just new day) will completely destroy them and no problem here?

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...