ValPerfMonitor
Testing tool: measures the CPU time and memory each mod and game system costs, with a test panel (F11), CSV logs and HTML reports.
About this mod Author’s original text
ValPerfMonitor
A testing tool. It measures what each installed mod and each part of Valheim itself costs, and takes its own cost out of the results. Install it in a test profile, measure, then remove it.
It answers questions like: which mod costs the most frame time? Which one makes garbage collection stutter? What was that freeze? How long does each mod add to startup? Is something leaking memory?
Requirements
- Valheim 1.0 (Unity 6, Mono) with BepInExPack_Valheim 5.4.23 or newer.
- Client side only. It measures whatever mods are installed; it needs none of them.
Recommended: ValBridge
The monitor works on its own, and ValBridge works without it, but they go well together. ValBridge lets an AI agent (or a script) drive the running game: start it, load a world, move the player, pin the weather. With both installed, the agent can run the monitor's tests, read the results and repeat them the same way every time, with no one at the keyboard. See Remote control for the commands the monitor adds, and examples/ for a test script to start from.
Installation
The release zip has two parts, and both are needed:
- plugins/ValPerfMonitor.dll: the monitor.
- patchers/ValPerfMonitor.Preloader.dll: a tiny helper that starts before any mod loads, so each mod's startup time can be measured. It patches nothing.
Gale / r2modman: Import → local mod and pick the zip. Manual: copy ValPerfMonitor.dll to BepInEx/plugins/ValPerfMonitor/ and ValPerfMonitor.Preloader.dll to BepInEx/patchers/ValPerfMonitor.
Use a separate test profile. The monitor attaches thousands of small hooks while it measures; it is not meant to stay installed for normal play.
Quick start
- Launch, load a world, go to the spot you want to test.
- Press F11, type a label such as all mods, choose Full suite, press Start, and stand still for about 4 minutes.
- Change one thing (remove a mod, change a setting), go to the same spot, run the suite again with a new label.
- Open BepInEx/ValPerfMonitor/compare.html and pick the two runs.
For before/after comparisons, set the game's FPS limit to unlimited and vsync off: a frame cap hides CPU savings.
Capture modes
Each capture records in one mode. Every capture gets its own folder and report.
| Mode | What it records | Hooks attached |
|---|---|---|
| Baseline | True FPS, frame-time percentiles, garbage collections (GC), render counters, world context | none |
| Timing | CPU self-time per mod method and per game system (about 200 vanilla update loops) | all |
| Allocations | Memory each mod and game system allocates per frame (what drives GC stutter) | all |
| Trace | Timing, plus a full flame graph of every slow frame (open at speedscope.app) | all |
The modes are kept separate on purpose. Allocation counting and trace recording each add their own overhead, so mixing them would blur the timing numbers. The full suite (Shift+F11) runs all four back to back at the same spot, 60 s of counted time each.
Test panel (F11)
F11 opens the test panel. While it is open the mouse is free, the game ignores movement, camera and attack input (as when typing on a sign), and no frames are counted. Press F11 again or ✕ to close it.
- Run a test: choose Full suite, Single test (one mode for a set time) or Continuous recording (until you press Stop), pick the mode, type a label (e.g. all mods, without Seasons), set the duration, and press Start. The panel closes and the test runs. A timed test saves its results and returns to idle when it finishes.
- Live view: the graph and the ranked table of mods and game systems. Click a row to see its heaviest methods.
- Results: captures finished this session (FPS, 1% low, heaviest mod) with a button for each report, plus Open comparison page and Open logs folder.
- Load times & memory: startup time (and each mod's share), every world load and logout this session, and the memory leak check.
- A Stop button in the panel header ends whatever is running and saves it.
- Optional live HUD: a small readout of the
Install & use Install: BepInEx plugin
- The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
- Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
- Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
- Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.
Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file. In multiplayer, the host and every client need the same mods installed.
Install these first, or the mod will not work: