Jump to content

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
https://forums.kleientertainment.com/forums/topic/35085-profiling-mod/
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.

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?

Edited by iWitch

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
  • Create New...