Skip to content

IGNITE-29169 Use CopyOnWriteIntMap for rarely updated maps on cache hot paths - #13706

Open
NSAmelchev wants to merge 2 commits into
apache:masterfrom
NSAmelchev:ignite-29169
Open

NSAmelchev wants to merge 2 commits into
apache:masterfrom
NSAmelchev:ignite-29169

Conversation

@NSAmelchev

Copy link
Copy Markdown
Contributor

Several int-keyed maps read on the cache operation path and updated only on cache start/stop
still pay for concurrent writes on every read: GridDhtLocalPartition.cacheMaps and
CacheDataStoreImpl.cacheSizes take a read-write lock on each access, DataRegionMetricsImpl.cacheGrpMetrics
is a hand-written copy-on-write map with its own lock, CacheObjectBinaryProcessorImpl.affKeyFields
boxes the type ID on each lookup.

They now use CopyOnWriteIntMap (IGNITE-29099), which is designed for this read-mostly case.
GridCacheContext.cacheIdBoxed() is removed as no longer needed, CopyOnWriteIntMap.computeIfAbsent
gets a lock-free fast path.

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