@@ -394,18 +394,34 @@ restarting DF.
394394
395395- ``dfhack.HIDE_ARMOK_TOOLS ``: Whether to hide "armok" tools in command lists.
396396
397- Miscellaneous notes
398- ===================
399- This section is for odd but important notes that don't fit anywhere else.
397+ Performance monitoring
398+ ======================
399+
400+ Though DFHack tools are generally performant, they do take some amount of time
401+ to run. DFHack tracks its impact on DF game speed so the DFHack team can be
402+ aware of (and fix) tools that are taking more than their fair share of
403+ processing time.
404+
405+ The target threshold for DFHack CPU utilization during unpaused gameplay with
406+ all overlays and automation tools enabled is 10%. This is about the level where
407+ players would notice the impact. In general, DFHack will have even less impact
408+ for most players, since it is not common for every single DFHack tool to be
409+ enabled at once.
410+
411+ DFHack will record a performance report with the savegame files named
412+ ``dfhack-perf-counters.dat ``. The report contains measurements from when the
413+ game was loaded to the time when it was saved. By default, only unpaused time is
414+ measured (since processing done while the game is paused doesn't slow anything
415+ down from the player's perspective). You can display a live report at any time
416+ by running::
417+
418+ :lua require('script-manager').print_timers()
419+
420+ You can reset the timers to start a new measurement session by running::
400421
401- * If a DF :kbd: `H ` hotkey is named with a DFHack command, pressing
402- the corresponding :kbd: `Fx ` button will run that command, instead of
403- zooming to the set location.
404- *This feature will be removed in a future version. * (see :issue: `731 `)
422+ :lua dfhack.internal.resetPerfCounters()
405423
406- * The binaries for 0.40.15-r1 to 0.34.11-r4 are on DFFD _.
407- Older versions are available here _.
408- *These files will eventually be migrated to GitHub. * (see :issue: `473 `)
424+ If you want to record performance over all elapsed time, not just unpaused
425+ time, then instead run::
409426
410- .. _DFFD : https://dffd.bay12games.com/search.php?string=DFHack&id=15&limit=1000
411- .. _here : https://dethware.org/dfhack/download
427+ :lua dfhack.internal.resetPerfCounters(true)
0 commit comments