LoadTimeProfiler
Startup and join profiling, optional acceleration, timeout protection, and reloadable log filtering
模組介紹 作者原文
LoadTimeProfiler
Profiles modded Valheim startup, world joins, and dedicated server boot. One patcher DLL also provides optional localization caching, config-write coalescing, timeout protection, logging filters, and automatic reload of other mods' BepInEx cfg files.
Features
- Measures Start to Lobby, Lobby to World, and dedicated server startup.
- Shows plugin construction, Awake, OnEnable, Start, and major lifecycle timings.
- Attributes synchronous Harmony callback time in ObjectDB.Awake and ZNetScene.Awake to individual mods.
- Optionally accelerates supported localization work and automatic BepInEx config writes.
- Applies a configurable timeout floor to supported vanilla, Jotunn, ServerSync, and AzuAntiCheat paths.
- Gives each mod four GUID-based log checkboxes, without inspecting the stack on each message.
- Reloads logging settings automatically, including on headless servers with no connected player.
- Optionally reloads other mods' registered BepInEx cfg files after local file edits, without an in-game administrator or ConfigManager.
- Keeps the newest 20 reports for comparison.
Installation
Place LoadTimeProfiler.dll in:
BepInEx/patchers
Do not place it in BepInEx/plugins. Install it separately on each client or dedicated server you want to profile.
Timeout protection is endpoint-local. Install the same build and timeout setting on both client and server when you want equivalent protection in both directions.
Usage
- Start Valheim normally.
- Wait for the main menu to measure Start to Lobby.
- Enter a world to also measure Lobby to World.
- Open the newest report in:
BepInEx/config/LoadTimeProfiler
Dedicated servers create a Server Startup report in the same directory. Compare multiple warm runs because disk cache, network conditions, world size, and background programs can affect loading time.
Start To Lobby starts at this patcher's Patch callback and ends when FejdStartup.Start completes. It does not include the entire executable startup or all later rendering. The earlier preloader config/Manual logging setup is outside that clock; use an external launch-to-menu measurement when comparing total startup cost.
In Valheim 1.0, the intro cinematic can continue after this boundary. Intro playback, skipping it, and the time until the menu accepts input are outside this measurement; the existing timing boundary stays unchanged.
Lobby To World starts when TransitionToMainScene accepts the world transition and ends when SpawnPlayer completes. Earlier login, password, permission, warning, and world-selection prompts are not included.
Configuration
The configuration file is:
BepInEx/config/sighsorry.LoadTimeProfiler.cfg
| Setting | Default | Purpose |
|---|---:|---|
| General.ProfilingEnabled | true | Measures loading times, creates timing reports and enables lifecycle and per-mod attribution. |
| General.LocalizationCacheEnabled | true | Caches supported vanilla and external localization work. |
| General.ConfigWriteCoalescingEnabled | true | Coalesces automatic config writes during Chainloader.Start. |
| General.ConfigAutoReloadEnabled | false | Automatically reloads other mods' registered BepInEx cfg files after local file edits. Restart required. |
| General.TimeoutProtectionSeconds | 120 | Sets the minimum supported connection and send-queue timeout. Use 0 to disable it. |
| Logging.Mods. | Errors, Warnings when absent | Allowed groups for the mod's default BepInEx logger. |
Each mod has four independent checkboxes. There is no logging master switch, common logger option, or source-name override.
| Checkbox | Config name | Default |
|---|---|---|
| Fatal + Error | Errors | Checked |
| Warning | Warnings | Checked |
| Message + Info | Information | Unchecked |
| Debug | Debug | Unchecked |
Unconfigured mods keep fatal/error/warning messages and suppress message/info/debug on their default logger. Clear every checkbox (None in the file) to silence that logger; select all four to allow every event,
安裝與使用 安裝:BepInEx 外掛
- 本站下載的壓縮包就是模組本體,通常是 BepInEx 外掛(解壓後得到 .dll 或外掛資料夾)。
- 建議流程:用社群模組管理器(如 r2modman)選中本遊戲後匯入該模組,管理器會自動裝好 BepInEx 前置並處理依賴。
- 手動流程:先在遊戲目錄裝好 BepInEx 載入器,再把解壓出的 .dll 或外掛資料夾放進 BepInEx/plugins/。
- 啟動遊戲,BepInEx 控制台會列印載入日誌;確認這個模組出現在日誌裡即為安裝成功。
帶「前置依賴」的模組需要一併安裝,否則不會載入。功能開關通常在遊戲內或外掛自帶的設定檔裡調整。 多人連線時,主機與所有用戶端需要安裝一致的模組。
下面這些內容需要先安裝,否則該模組不會生效: