From c341ec4c9abd1bfc7bb6a4a959d736ad70c6c63d Mon Sep 17 00:00:00 2001 From: Symmetricity <184246+Symmetricity@users.noreply.github.com> Date: Thu, 4 Jun 2026 11:08:10 +0200 Subject: [PATCH] Increase AttributeStore lookup caches 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 --- src/attribute_store.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/attribute_store.cpp b/src/attribute_store.cpp index 73ed4775..93b813e8 100644 --- a/src/attribute_store.cpp +++ b/src/attribute_store.cpp @@ -101,8 +101,8 @@ const AttributePair& AttributePairStore::getPairUnsafe(uint32_t i) const { thread_local uint64_t tlsPairLookups = 0; thread_local uint64_t tlsPairLookupsUncached = 0; -thread_local std::vector cachedAttributePairPointers(64); -thread_local std::vector cachedAttributePairIndexes(64); +thread_local std::vector cachedAttributePairPointers(256); +thread_local std::vector cachedAttributePairIndexes(256); uint32_t AttributePairStore::addPair(AttributePair& pair, bool isHot) { if (isHot) { { @@ -300,8 +300,8 @@ void AttributeSet::finalize() { // Remember recently queried/added sets so that we can return them in the // future without taking a lock. -thread_local std::vector cachedAttributeSetPointers(64); -thread_local std::vector cachedAttributeSetIndexes(64); +thread_local std::vector cachedAttributeSetPointers(256); +thread_local std::vector cachedAttributeSetIndexes(256); thread_local uint64_t tlsSetLookups = 0; thread_local uint64_t tlsSetLookupsUncached = 0;