Skip to content

perf(scan): warm icon templates off the scan path after each engine build - #74

Open
DysektAI wants to merge 3 commits into
perf/bench-baselinefrom
perf/icon-template-warmup
Open

DysektAI wants to merge 3 commits into
perf/bench-baselinefrom
perf/icon-template-warmup

Conversation

@DysektAI

@DysektAI DysektAI commented Oct 19, 2026 •

Copy link
Copy Markdown
Member

Stacked on #71 — retarget to master after it merges. Depends on tarkovtracker-org/RatEye#5; the submodule points at that PR's head (ee7fa47) and should be re-pointed to the merged SHA before merge.

Why

RatEye loads static templates lazily inside the first icon scan of each slot size, under the icon-scan lock, after hashing the icon folder. Every engine build therefore made the next icon scan ~300 ms slower.

What

  • After a publish, warm the most common slot sizes covering 80% of items (1x1, 2x1, 2x2, 1x2 on the live catalog) on a background task, one size at a time under IconScanLock and only while that engine is still published, so a rebuild can never dispose it mid-load.
  • RatEye bump: warm-up API, no per-scan full-image debug clone or full-capture ToBitmap.
  • Latency harness gains a warm-up case; gauge engine.icon_warmup_ms.

Results (Release, 2560x1440 fixtures, 3 runs)

Metric Before After
First icon scan after an engine build ~490-550 ms ~195-230 ms
Background warm-up — ~620 ms (2.1 s first-ever, cold disk cache)
Idle private bytes ~692 MB ~715 MB
Idle GPU 3D / CPU median 0% / 0 0% / 0

Validation

  • IconWarmUpSlotSizesTests (ordering, coverage cut-off, zero sizes, empty catalog); RatEye warm-up tests with mutation proof.
  • Debug and Release build; dotnet test 412/412; CodeRabbit findings fixed (GPU per-instance deltas, ROI Mat disposal).

https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2

…uild

RatEye loads static icon templates lazily inside the first scan of each
slot size, under the icon-scan lock, after hashing the whole icon
folder. Every engine build (startup, display change, settings, catalog
change) therefore made the next icon scan ~300 ms slower.

- Bump RatEye to cf5d2c6 (adds RatEyeEngine.WarmUpIconTemplates and
  drops two per-scan full-image copies).
- After a publish, warm the most common slot sizes covering 80% of
  items (1x1, 2x1, 2x2, 1x2) on a background task, one size at a time
  under IconScanLock and only while that engine is still published, so
  a rebuild can never dispose it mid-load.
- Latency harness gains a warm-up case.

Measured on 2560x1440 fixtures: first icon scan after a build ~490-550
ms -> ~195-230 ms (warm p50 ~185 ms); background warm-up ~620 ms; idle
private bytes ~692 MB -> ~715 MB; idle CPU/GPU unchanged.

Claude-Session: https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2
@coderabbitai

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 5d5b7ec6-8a0d-4779-9f7f-c9124429ccbe

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant