Increase AttributeStore lookup cache size#914
Merged
systemed merged 1 commit intoJun 4, 2026
Merged
Conversation
Attribute pair and set lookups are very frequent during profile processing. The existing 64-entry thread-local caches leave more repeated lookups falling back to the shared stores on larger fixtures. Use a still-small 256-entry cache so more hot lookups are served locally without changing generated tile semantics. Co-authored-by: Codex <codex@openai.com>
Owner
|
Thanks! |
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.
This PR is AI generated.
Summary
This is the AttributeStore cache-size part split out from #912, as requested
after #913 extracted the vector-layer metadata update cache.
It increases the small thread-local AttributeStore lookup caches from 64 to 256
entries:
cachedAttributePairPointerscachedAttributePairIndexescachedAttributeSetPointerscachedAttributeSetIndexesThe lookup behavior, shard selection, locking behavior, and generated output
semantics are otherwise unchanged.
Background
AttributeStorealready uses small thread-local direct-mapped caches to avoidfalling through to the shared sharded stores for repeated attribute pair/set
lookups. Large OpenMapTiles runs can have enough hot attribute combinations
that the current 64-entry caches collide frequently.
This keeps the existing cache design, but gives common attribute pairs and sets
more room to remain in the local worker cache.
Performance
During candidate acceptance, this was measured on a warmed Austria
OpenMapTiles run with PMTiles output, no
--store, and--threads 8. Thecomparison was run in both forward and reverse alternating order on the
submitted/open PR stack used for performance investigations.
Combined six-run result:
The runtime effect is small, but it reduced minor faults, voluntary context
switches, and peak RSS on that fixture.
Possible Regressions
The intended output behavior is unchanged.
The cost is slightly larger thread-local vectors per worker thread:
This is still a small fixed-size per-thread cache and does not change shared
store ownership or synchronization.
Testing
Build:
cmake -S . -B local-builds/attribute-store-lookup-cache-size -DCMAKE_BUILD_TYPE=RelWithDebInfo cmake --build local-builds/attribute-store-lookup-cache-size --parallel 8Code style:
Semantic checks from candidate acceptance: