Repository navigation
deps: bump go-ruby-prime to segmented-sieve fix (Prime.each 12.7x->1.4x MRI) - #113
Merged
Merged
Conversation
…->1.4x MRI) go-ruby-prime#1 replaced the per-candidate Baillie-PSW generator with a memoized segmented int64 sieve (MRI-parity semantics). rbgo's go.mod still pinned the pre-fix pseudo-version, so the shipped interpreter kept paying the slow enumeration. Bump to the merged main pseudo-version: Prime.each_factor drops from ~135900 ns/op (12.68x MRI) to ~15300 (1.41x) measured end-to-end through rbgo. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tannevaled
added a commit
that referenced
this pull request
Jul 3, 2026
This branch predated #113 (the go-ruby-prime segmented-sieve bump), so its go.mod still pinned the pre-fix version. Match main's pin so merging this PR does not regress Prime.each back to ~12.8x MRI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
tannevaled
added a commit
that referenced
this pull request
Jul 3, 2026
…114) * perf(vm): int64 fast path + batched arg-boxing for sprintf/String#% The format binding routed every operand through the go-ruby-format Value interface, and every integer through math/big: a profile of a sprintf-heavy loop showed the format path was GC-bound on those allocations (not on re-parsing the format string). Two allocation cuts on the Kernel#sprintf / Kernel#format / String#% path: * formatValue implements the library's Int64Fast fast-path, so a native Integer (and an int64-range Bignum) formats without allocating a *big.Int. This activates once go.mod consumes the go-ruby-format/format int64 fast path; it is inert but harmless against the current release. * formatString wraps the N operands in a single backing array referenced by pointer, replacing one interface box per argument with one allocation for the whole batch. Isolated format path (rbgo objects, bypassing the interpreter): before 688 ns/op, 32 allocs/op after 418 ns/op, 11 allocs/op (1.65x, once the library bump lands) Byte-exact MRI output is unchanged (the differential/golden sprintf tests stay green); internal/vm keeps 100% coverage, with a new Int64Fast branch test. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * deps: bump go-ruby-format + go-ruby-zlib to their perf fixes Activates the two library-side perf fixes end-to-end in rbgo: - go-ruby-format: math/big-free int64 fast path (format engine 1.65x; headline sprintf gap is VM-general per-op alloc, not the formatter). - go-ruby-zlib: pooled flate engines via Reset (zlib roundtrip 51554->6653 ns/op = 0.88x MRI, now faster than C zlib; byte-identical output, MRI interop preserved). Adds klauspost/compress (indirect). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> * deps: also carry the go-ruby-prime sieve bump (avoid reverting #113) This branch predated #113 (the go-ruby-prime segmented-sieve bump), so its go.mod still pinned the pre-fix version. Match main's pin so merging this PR does not regress Prime.each back to ~12.8x MRI. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> --------- 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.
Consumes go-ruby-prime#1 (memoized segmented int64 sieve). rbgo's
go.modstill pinned the pre-fix pseudo-version so the shipped interpreter kept the slow per-candidate Baillie-PSW enumeration.Measured end-to-end through rbgo (harness prime.enum_factor, warm): ~135900 ns/op (12.68x MRI) -> ~15300 ns/op (1.41x MRI). Enumeration now fast; residual is factorization + binding.
Dep-bump only; MRI-parity semantics preserved by go-ruby-prime#1 (differential oracle stays green).
🤖 Generated with Claude Code