Repository navigation
perf(set): specialized-hash membership index results - #3
Merged
Merged
Conversation
…ion + membership Record the 2026-07-03 specialized-hash results. The membership index gained a concrete-typed fast path (int / int64 / string) with a generic fallback, cutting the interface-hashing cost that kept build/union above MRI+YJIT. Best-of (Apple M4 Max, ruby 4.0.5 +PRISM/+YJIT), vs MRI / vs YJIT: intersection-1000 0.78x / 0.82x beats MRI + YJIT membership-1000 0.28x / 0.74x beats MRI + YJIT union-1000 1.07x / 1.06x parity build-1000 1.35x / 1.33x honest floor (order slices Go maps lack) Pin the benchmark go.mod to the feature commit so the numbers reproduce, and gitignore the compiled bench binary. 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.
Records the 2026-07-03 specialized-hash results for
go-ruby-set/setand pins the benchmark to the feature commit.Companion to the library PR go-ruby-set/set#2, which replaces the single
map[any]struct{}membership index with a concrete-typed fast path (allint/ allint64/ allstring) plus a generic fallback — cutting the interface-hashing cost that keptbuildandunionabove MRI+YJIT, while preserving exact Ruby member identity (int(1),int64(1),1.0,"1"stay distinct; a homogeneous set that gains a mixed-type member migrates to the generic map losslessly).Results (best-of, Apple M4 Max,
ruby 4.0.5 +PRISM/+YJIT)build/unionresidual is the two parallel insertion-order slices Go must keep because Go maps aren't insertion-ordered — the typed-map dedup alone is already ~MRI parity. Documented as the honest floor.Reproducibility
benchmarks/go/go.modnow pins the library feature commit2d4cab3(pseudo-versionv0.0.0-20260703173733-2d4cab35516f), verified to resolve from the proxy and reproduce the numbers.benchbinary added to.gitignore.Important
The pin targets the feature commit on go-ruby-set/set#2. Please merge that PR with a merge commit (not squash) so
2d4cab3stays reachable onmainand this pin keeps resolving. If it is squashed, I will re-pin this go.mod to the resultingmainpseudo-version.🤖 Generated with Claude Code