Skip to content

Commit a2e8f3c

Browse files
java-team-github-botGoogle Java Core Libraries
authored and
Google Java Core Libraries
committedOct 5, 2022
Optimize the memory footprint of MapMakerInternalMap entries by special-casing linked entries.
The first entry in each bucket does not need a `next` field because it will only ever be the tail of the bucket's linked list. Because `MapMakerInternalMap` uses a load factor of 0.75, we can expect that most entries are tails, so long as the hash function is good. For the common use case of a weak interner with compressed OOPs, omitting the `next` field reduces the shallow heap of `WeakKeyDummyValueEntry` from 40 bytes to 32 bytes. RELNOTES=Memory optimizations for `Interner` and `MapMaker` PiperOrigin-RevId: 479157599
1 parent 5ed6e43 commit a2e8f3c

File tree

2 files changed

+332
-261
lines changed

2 files changed

+332
-261
lines changed
 

0 commit comments

Comments
 (0)