Skip to content

perf(scan): skip engine rebuild when a catalog refresh only changes prices - #73

Merged
DysektAI merged 3 commits into
masterfrom
perf/skip-price-only-rebuild
Oct 22, 2026
Merged

DysektAI merged 3 commits into
masterfrom
perf/skip-price-only-rebuild

Conversation

@DysektAI

Copy link
Copy Markdown
Member

Why

Every items-cache refresh (1 h TTL, started from inside a scan) rebuilt the whole RatEye engine, discarding the warm icon-template cache. Bench: the next icon scan cost ~490 ms instead of ~185 ms, about once an hour.

What

  • ItemDatabaseSignature: order-independent hash of exactly the fields ToRatStashItem copies (id, name, short name, size, background).
  • The published engine remembers its signature; OnItemsCacheUpdated keeps the engine when the refreshed catalog has the same signature. New counter engine.rebuild_skipped_unchanged_items (documented).

Validation

  • Tests: price-only and reordered payloads keep the signature; each hashed field, item add/remove, and id change alter it. Removing any hashed field, or adding the price, fails a test.
  • Debug and Release build; dotnet test 411/411; CodeRabbit: no findings.

https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2

…rices

Every items-cache refresh (1 h TTL, started from inside a scan) rebuilt
the whole RatEye engine, which also throws away the warm icon-template
cache: the next icon scan paid ~300 ms extra (bench: warm ~185 ms vs
~490 ms first-after-rebuild).

Hash exactly the fields ToRatStashItem copies (id, names, size,
background) order-independently, remember it for the published engine,
and keep the engine when a refresh leaves it unchanged. Counted as
engine.rebuild_skipped_unchanged_items.

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

coderabbitai Bot commented Oct 19, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

Next included review available in 37 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 68 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 92d58f3c-8fa5-4b62-a76b-d9bae24730d0
📥 Commits

Reviewing files that changed from the base of the PR and between c15eda6 and cfb5f52.

📒 Files selected for processing: 3
  • docs/agent-context/performance-diagnostics.md
  • src/App/RatScannerMain.cs
  • tests/RatScanner.Tests/ItemDatabaseSignatureTests.cs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@DysektAI
DysektAI merged commit b0f2999 into master Oct 22, 2026
9 checks passed
@DysektAI
DysektAI deleted the perf/skip-price-only-rebuild branch October 22, 2026 11:47
@DysektAI DysektAI self-assigned this Oct 22, 2026
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