ValPerfMonitor

版本 v1.0.1·更新於 2026-10-10

Testing tool: measures the CPU time and memory each mod and game system costs, with a test panel (F11), CSV logs and HTML reports.

模組介紹 作者原文

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

安裝與使用 安裝:BepInEx 外掛

  1. 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
  2. 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
  3. 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
  4. 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。

帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。

前置依賴

下面這些內容需要先安裝,否則該模組不會生效:

denikson-BepInExPack_Valheim

檔案與校驗

檔案名稱
ValPerfMonitor-1.0.1.zip
檔案大小
132.7 KiB