Performance reports
Reports of Tools/Dev/Perf-Test.ps1 (Performance test in Docs/Development.md) worth keeping: one JSON and its markdown
summary per run. A new run compares with ./Tools/Dev/Perf-Test.ps1 -Compare Docs/perf/<old>.json BuildOutput/perf/<new>.json.
2026-12-01: the in-game menu's first opening (branch perf/menu-first-open)
2026-12-01-menu-first-open.md (--menu-tour, the Jetson, --quality quest3): the menu built and each tab drawn once behind
the loading screen (the startup preload): the first opening 1 041 ms + a 1 439 ms frame → 27 ms + 99 ms, as the second;
the 232 item icons kept on the disk (IconCache): 2.6-6.2 s drawn → 0.56 s read at start.
2026-12-01: the forest's mobs and the glide on the main thread (branch perf/mobs-glide)
2026-12-01-mobs-glide.md (*-mobs-glide-*.json): the mobs' level of detail (MobLod, MobCrowd: no mob hidden any more),
the ground encoded off the main thread. Forest: Quest 2 19.9 → 72.4 fps, Quest 3 25.2 → 72.5; glide 69.2 → 70.0 and
69.7 → 71.2, then (the follow-up: the voice's microphone on its own thread, the mobs' models on a worker, the terrain's
arrays pooled) 71.6 and 71.3; a dungeon offline: 72 fps at the entrance and in the champion's hall on both (the hall at 94 %
of the Quest 2's GPU). Follow-up 3: entering the world waits for the startup preload; the dungeon's caverns' lights only near the
eyes on a Quest 2 (the hall 96 % → 79 % of its GPU), at most 16 fighting mobs near (the hall's rally: 72.7 fps); the glide's
allocations 137 → 36 MB, the CPU's clock floor raised (cpuLevel 3): 71.9 fps gliding on the Quest 2. Follow-up 4: the caves' lights within 30 m on the Quest 3 too (its hall's rally 85 % → 56 % of
its GPU); the savings that change nothing seen brought to the PC (back faces, the caves' lights past the fog's reach), the PC
measured: forest 56 → 199 fps, town 174 → 198; a regression of the startup preload on a PC (Vulkan allocations) fixed.
2026-12-01: the Quest 2 and the Quest 3 in six places, the Quest 2's profile tuned (branch perf/quest2, Tools/Dev/Quest-Places.ps1)
2026-12-01-quest2-town.md (*-quest2-q2f-* the Quest 2 after, q2b before, q3f the Quest 3, q3m the Quest 3 with the mob
radius, q2q3 the Quest 2 on the Quest 3's profile): town, meadow, forest, mountains, lake and a glide. The forest had 139 mobs:
20 fps on the Quest 2 (25 on the Quest 3) with the GPU idle, 72 once a hidden mob's whole view stops processing. The Quest 2's town
86 % → 74 % of its GPU at full clock (its clock moves: gpu_full_pct). Glide: 69 fps on both, not tuned.
2026-11-30: the Quest 3 in town, the terrain made cheap (branch perf/quest-terrain, Tools/Dev/Quest-Perf.ps1)
2026-11-30-quest3-town.md: measured on the headset, before / after, and what cost what (*-quest3-*.json). GPU busy 95 % →
77 % at 72 fps, draw calls 751 → 158, triangles 1.03 M → 0.49 M; the buildings are now the biggest cost. Then no
shadows at all on a Quest: 76 %, 130 draw calls, 373 k triangles. Then the town without houses, raid hall and dungeons' gate: 59 %, 294 k triangles.
2026-11-30: what pets, wings, updrafts, stamina, quests and NPCs cost (branch feat/bound-gifts, run from the jetson)
2026-11-30-1125-staging: staging, 50 bots without / with pets, walking, the client in town and "outside" (staging gives no DEV role: "outside" stayed by the fountain, the same view). The 100 and 200 bots rows of this run are empty (a bug of the script, fixed: the bots' account index).2026-11-30-1140-staging: staging, 100 bots without / with pets (the 200 bots rows are empty: the jetson cannot run 200 bots, their process took 7 cores and never reported).2026-11-30-1200-local-jetson: the local backend on the jetson (Start-Dev.ps1, a .NET headless GameServer; bots, servers and client on the same machine: only the comparisons count), 50 and 100 bots × pets × walking / flying, with the servers' metrics (staging's version had no admin route for them yet, nor the bots' wings).
Staging could not give the servers' metrics nor flying bots: its version predates GET /api/admin/server-metrics and
POST /api/admin/service-wing. Run it again once staging has this branch.
What stands out:
| Pets off → on | Walk → fly | |
|---|---|---|
| Bandwidth per player (staging, 50 / 100 bots) | 18.2 → 23.0 kB/s (+26 %) / 24.3 → 33.9 kB/s (+39 %) | — |
| Bandwidth per player (local, 50 / 100 bots) | +22 % / +15 % walking, +22 % flying | +22 % / +24 % |
| GameServer tick, mean (local, 50 / 100 bots) | 4.5 → 4.9 ms / 6.7 → 7.1 ms (+5 to +9 %) | lower (the flying bots do not fight) |
| Client fps, town (staging, 50 bots) | 70.6 → 54.1 (−23 %), p99 16.7 → 24.5 ms | — |
| Client fps, town (local, 50 bots) | 66.3 → 48.2 (−27 %) walking, 73.5 → 54.5 (−26 %) flying | no loss seen |
| Client draw calls / nodes (local, town) | 848 → 1043 (+195 for ~39 pets) / 7 991 → 10 706 (+2 700: ~70 nodes a pet) | ~the same |
- The pets are the cost: about 5 draw calls and 70 scene nodes each on the client, a quarter of the frame rate with 25 to 40 in sight; and a fifth more bytes per player (each pet is an entity in the snapshots, moved by the server).
- Flying: the wings worn and the glides cost no client frame rate seen here; the gliding players' moves cost about a fifth
more bytes (faster positions, more cells crossed). The wing trails were never counted as emitting particles (the count
stayed at the scene's 1 628): to check whether
WingView's trail emits for others' glides. - The GameServer stays far under its 33 ms budget (p95 ≤ 12 ms at 100 bots on the jetson); its longest ticks (30 to 55 ms)
come in all scenarios, with or without pets: spikes to look at (GC, saves?).
Investigated (2026-11-30, node4, 100 bots walking, a
Slow ticklog line inGameServerHostfor ticks over 20 ms, with the time of each part and the GC counts): the GC is not it (gen0 +0 in nearly every slow tick, never a gen2). Biggest: the bots coming in together: the network/queue part (login, JIT) and the saves: 100 characters saved in one tick (88 ms), now at mostCharacterSaver.MaxSavesPerTick(4) a tick. The rest, in the steady state, isMobAiSystem.Tick(20-45 ms now and then, about half of the slow ticks), thenUpkeepSystemandPetSystem(7-9 ms): not pinned to one cause yet (many mobs near 100 bots).
2026-11-30: the pets made cheap (branch perf/pets, run on chopper: AMD integrated GPU, 16 threads)
2026-11-30-1503-local-chopper-before(commit db72f2ee) and2026-11-30-1512-local-chopper-after(8823cdf3): the local backend (Start-Dev.ps1), 50 bots walking without / with pets, the client in town (bots, servers and client on the same machine: only the comparisons count).- What changed: on the client a pet is one skeleton and one skinned mesh (
PetModel, one material) instead of a node and a draw call per piece, no name plate node, the orbs' meshes and materials shared; only the own pet and the 8 nearest within 18 m are posed, the others drawn at rest per kind in a multimesh (PetCrowd), none beyond 70 m (PetLod). On the wire a pet goes in a snapshot only when its clients would show it wrong (PetSync: its action, its orbs, 0.2 m off the line they extrapolate, 14° off its heading, or a keep-alive every 0.8 s).
| Before: pets off → on | After: pets off → on | |
|---|---|---|
| Gateway bandwidth per player | 20.09 → 24.85 kB/s (+24 %) | 20.00 → 19.82 kB/s (no difference seen) |
| Bots' received kB/s each | 19.7 → 25.0 (+27 %) | 19.4 → 19.9 (+2 %) |
| Client fps, town | 116.3 → 22.7 (see below) | 122.6 → 116.3 (−5 %) |
| Client frame p95 / p99 (ms) | 10 / 11.3 → 112.5 / 134.3 | 9.4 / 10.4 → 9.7 / 12.5 |
| Client draw calls | 809 → 951 (+142) | 769 → 788 (+19 for 39 pets) |
| Client render CPU (ms) | 2.0 → 48.1 | 1.8 → 1.8 |
| Client nodes | 8 262 → 3 883 (see below) | 7 912 → 7 962 (+50 for 39 pets) |
- Before, with pets, this GPU broke down: the client's log is full of
Can't create buffer ... (VkResult error -10)(too many Vulkan objects: every pet's 15 to 26 pieces, its two orb meshes and materials), the frame took 44 ms on average and the entities stopped being drawn (none counted in sight at the end). On the jetson the same cost was −27 % fps (above). After: no Vulkan error, 39 pets in sight cost 5 % of the frame rate. - The GameServer's tick is unchanged (1.7 ms mean with pets, before and after); the servers' CPU % of the two runs differ with the machine's load (the bots and the client on the same PC), not with the pets.
Tests/Shared.Tests/PetSyncTests.cs: a walking, turning, stopping player's raccoon, dog and falcon are sent in fewer than half the snapshot rounds, and a client following only what it is sent shows them within 0.2 m at every round.
2026-11-30: the GameServer's tick spikes (branch perf/server-spikes, node4, the local backend)
The question: ticks of 20 to 45 ms in the steady state, pinned before on MobAiSystem.Tick, then UpkeepSystem and
PetSystem. Measured with 100 walking bots (Perf-Test.ps1 -Bots 100 -Pets off,on -Moves walk -Warmup 45 -Window 90; bots,
servers and services on the same 8-core ARM machine), the GameServer profiled finely: each system's time, each mob's
steps (NOF_TICK_PROFILE=1), the bytes allocated, the obstacle chunks built, and the tick thread's own time on a CPU and
waiting for one (Linux's schedstat), in the Slow tick log line (Where a slow tick went in Docs/Development.md).
What the profile showed:
- No slow code in the steady state. Over 3.5 minutes of 100 bots fighting (about 170 mobs), Release: no tick over 20 ms; the Debug build (what the servers' image ran, below): one. The slow ticks seen came in two kinds only.
- Waiting for a CPU. In a slow tick the time lands on whatever ran: one idle slime's tick 29 to 62 ms,
UpkeepSystemof 100 players 31 to 42 ms (0.1 ms normally),regen188 ms; with no allocation, no GC, no chunk built. The schedstat numbers say it:Slow tick 202.4 ms (on a CPU 1.7 ms, waiting for one 199.3 ms). It happens when the machine is overloaded: 100 bots logging in or out together (load 9 on 8 cores), or a build running beside the test (all the slow ticks of theafterrun, pets on, came while adotnet buildran: 43.9 ms = 6.6 on a CPU + 37.2 waiting). Not the game's code:MobAiSystem,UpkeepSystemandPetSystemwere only where the thread happened to be. On staging (every service, Postgres and ClickHouse on one machine) the same holds; the new log line tells it there too. - First times. On a fresh server (staging's, each time it is rebuilt) the first use of a path cost its compilation
and its static data on the tick: the first players entering 217 + 211 ms on a CPU, the first shot 46 ms (103 kB: the
configs), the first fight's record 29 ms, the first saves 37 ms. Fixed:
Warmupdoes it all before the players (1.3 s at the start, on a background thread: 804 types, 6 412 methods, a save's JSON). Then the same wave of 100 bots: the entering 68 + 40 ms, no first-shot, first-fight nor first-save tick any more. - The servers' GameServer ran unoptimized code:
Docker/gameserver.Dockerfilebuilt it-c Debug(Godot, run from the project folder, loadsbin/Debug), so the JIT compiled the whole simulation without optimizations. Now-c Debug -p:Optimize=true(the libraries too). LocallyStart-Dev.ps1 -Releasedoes the same. Here, with this little work per tick (~2 ms), the two builds measured alike (below): the gain is in the heavy ticks (a crowd, a raid), not measured here.
| 100 bots, walking (local, node4) | Debug (as the image was) | Release | Release + warm-up (after) |
|---|---|---|---|
| GS tick mean / p95 / max, pets off (ms) | 1.71 / 4.74 / 17.1 | 1.75 / 4.29 / 10.1 | 1.91 / 5.39 / 10.8 |
| GS tick mean / p95 / max, pets on (ms) | 1.87 / 4.57 / 6.3 | 1.65 / 4.83 / 10.8 | 2.31 / 17.9 / 43.9 (*) |
| Ticks over 20 ms in the steady state (3.5 min, pets off) | 1 | 0 | 0 |
| Ticks over 20 ms, 100 bots logging in (on a CPU > 15 ms) | — | 25 (5) | 32 (3: the entering only) |
(*) While a dotnet build ran on the same machine: every one of its slow ticks waited for a CPU (at most 6.6 ms on one).
The NOF_TICK_PROFILE=1 profile was on in all three (a few timestamps per mob: ~0.2 ms a tick at most).
Reports: 2026-11-30-1420-local-node4-debug, 2026-11-30-1410-local-node4-release, 2026-11-30-1436-local-node4-after.
Next, if staging still shows spikes: read its Slow tick lines. Mostly waiting for one: the GameServer needs its own core
(the Orchestrator's Docker provider could give its containers more CPU shares than the databases'); mostly on a CPU:
the parts and the mob steps say where.
Also found on the way (the quest test's flight): on this base the --fly bots never climbed the tower (they aimed under
its upper turns and stuck on a support), and when they did, they stopped exactly at the ramp's top, where
SafeZoneTower.StandOn gives the turn below: they crossed the deck on the ground and every "glide" started from there.
Fixed in the bots (BotFlight): a run with -Moves fly from before this branch measured bots walking round the tower,
not flying.