Repository navigation
perf(scan): skip engine rebuild when a catalog refresh only changes prices - #73
Merged
Merged
Conversation
…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
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. Next included review available in 37 minutes. View limit details
Comment |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 fieldsToRatStashItemcopies (id, name, short name, size, background).OnItemsCacheUpdatedkeeps the engine when the refreshed catalog has the same signature. New counterengine.rebuild_skipped_unchanged_items(documented).Validation
dotnet test411/411; CodeRabbit: no findings.https://claude.ai/code/session_01QFKiA2aswHyp8SnpraLxE2