Skip to content

Commit 959157b

Browse files
authored
Merge pull request #4539 from DFHack/myk_perf_docs
document perf system
2 parents 741ee77 + 5bcb5b3 commit 959157b

File tree

2 files changed

+37
-12
lines changed

2 files changed

+37
-12
lines changed

docs/Core.rst

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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)

docs/Installing.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,15 @@ To download a development build from GitHub:
8383
You can extract this package the same as if you are doing a manual install (see
8484
the next section).
8585

86+
Older releases
87+
--------------
88+
89+
If you are downloading DFHack for very old versions of DF, the binaries for
90+
0.40.15-r1 to 0.34.11-r4 are on DFFD_. Even older versions are available here_.
91+
92+
.. _DFFD: https://dffd.bay12games.com/search.php?string=DFHack&id=15&limit=1000
93+
.. _here: https://dethware.org/dfhack/download
94+
8695
Installing DFHack
8796
=================
8897

0 commit comments

Comments
 (0)