Jump to content

Profiling your Mod


Cheerio

Recommended Posts

  • Developer

Don't Starve comes equipped with a cpu frame profiler to help you track down performance problems with your mod.  The profiler makes use of the Chrome Tracing Visualizer to let you see where all your precious cpu time is being spent.

 

To run the profiler you will need:

- Google Chrome

- Debug Keys Enabled

 

Step 1: Launching the Profiler

post-283016-0-57557100-1381986271_thumb.

To launch the profiler, press the 'backspace' button in game up the profiling hud.  Now press 'ALT+/' to start recording and then again to stop.  Your profile will be saved to 'dont_starve/data/profile.json'.

 

Step 2: Launching Chrome Tracing

post-283016-0-26539600-1381986273_thumb.

 

The Chrome Tracing Visiualizer can be launched by starting Chrome and browsing to 'chrome: //tracing/'

 

Step 3: Loading your Profile

post-283016-0-62348400-1381986274_thumb.

Click load and open 'dont_starve/data/profile.json'.

 

Step 4: Visualizing your Profile

post-283016-0-40180700-1381986275_thumb.

You should now see a breakdown of all the frames you recorded.  You can use 'CTRL+LMB' and 'ALT+LMB' to pan and zoom.  If you want your profiles to have finer detail, you can add markers by wrapping your code with:

TheSim:ProfilerPush('marker_name')--Put slow code here :)TheSim:ProfilerPop()

And that's it!  Hopefully this will help you track down performance problems with your mod.

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...