Add FlatHashtable open-addressed find-or-create collection#11980
Draft
dougqh wants to merge 2 commits into
Draft
Add FlatHashtable open-addressed find-or-create collection#11980dougqh wants to merge 2 commits into
dougqh wants to merge 2 commits into
Conversation
…hism helpers A reusable open-addressed table over self-contained entries (one reference per slot), designed so callers specialize it via a concrete-typed static-final Helper that the JIT devirtualizes and inlines (C++-template-style static polymorphism). Cardinality cap / overflow / size are caller policy; this class is pure mechanism (capacityFor, create, get, getOrCreate). Includes a String-key StringHelper that seals a spread hash. Intended as the shared backing for several open-addressed caches/tables (per-operation sizing hints, UTF8BytesString caches, etc.). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This comment has been minimized.
This comment has been minimized.
Contributor
🟢 Java Benchmark SLOs — All performance SLOs passed
PR vs. master results
Commit: Load and DaCapo benchmarks can be triggered manually in the GitLab pipeline. Results will appear in the Benchmarking Platform UI after completion. |
Force hash collisions via fixed-hash helpers to exercise the linear-probe paths the original tests missed: probe-past-occupied + match-after-probe (in both get and getOrCreate), wraparound to the front, and get()'s full-table wrap-to-null branch. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
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.
From Claude:
A reusable open-addressed table over self-contained entries — one reference per slot, so entry publication is a single reference store and readers see null-or-complete (no torn reads, no
volatile/atomics needed when the payload makes a stale/lost read benign).Callers specialize it via a concrete-typed
static finalHelper(orStringHelper) that the JIT devirtualizes and inlines — C++-template-style static polymorphism: one algorithm, one monomorphic instantiation per call site.Helperis an abstract class on purpose (forces a named type;invokevirtualfallback if inlining ever misses);StringHelperseals a spreadhashso String-key callers write onlymatches/create.Pure mechanism —
capacityFor,create(typed backing array viaArray.newInstance),get,getOrCreate. Cardinality cap / overflow / a live-size counter are caller policy.Intended as the shared backing for several open-addressed caches/tables (per-operation sizing hints,
UTF8BytesStringcaches, …). This PR is just the standalone collection + unit tests; callers land separately.Draft caveat: authored without a local module build (to stay off an in-progress release), so
spotlessCheck/spotbugsMain/ compile want CI (or aspotlessApplypass) to confirm.🤖 Generated with Claude Code