Skip to content

perf: pursue measured 1:1 Perl throughput (#1863) - #1870

Merged
fglock merged 37 commits into
masterfrom
perf/issue-1863-throughput
Oct 26, 2026
Merged

fglock merged 37 commits into
masterfrom
perf/issue-1863-throughput

Conversation

@fglock

@fglock fglock commented Oct 22, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • Optimize the guarded stable hash-method path, including revisioned field-cell caching, compact invocant prepend, and safe reuse of method argument arrays.
  • Preserve ordinary fallback behavior and add regression coverage for mutation, aliases, escaped argument arrays, and fallback transitions.
  • Make Python and system Perl optional for the default make gate. Gradle/Groovy now generates and merges the SBOM and verifies Joni packaging; Perl oracle/generator and Python benchmark checks remain opt-in.

Validation

  • nice -n 19 timeout 3600 make passed with both python3 and perl blocked in PATH (16m43s).
  • nice -n 19 make test-perl-optional passed with Perl available.
  • nice -n 19 make check-links passed.
  • Current-head GitHub CI passed on ubuntu-latest and windows-latest.

Pinned blead performance

The 14-pair acceptance portfolio is recorded in dev/bench/reports/issue-1863-pr-port-full-14pair-blead.json (candidate JAR SHA-256 24e93fd8e555725c7291ac306d86fe10c155604e5f85d9a8e8ac859c6023e490). PerlOnJava/Perl throughput ratios and 95% paired bootstrap intervals:

Workload Ratio 95% interval
Method anchor 1.059x 1.040–1.088
Closure anchor 1.547x 1.524–1.564
Bit-packed Life 1.100x 1.058–1.167
Portfolio geometric mean 1.217x 1.197–1.243

All 42 engine runs had matching checksums and verified scheduling priority. Each defined workload's lower confidence bound exceeds 1.00x.

Remaining work

The throughput acceptance criteria in #1846 and #1196 are met. The broader memory accounting and call-shape profiling from #1863 are unfinished and tracked in follow-up #1885. The seven-group portfolio from #1196 remains unmeasured beyond the three #1863 anchors.

Closes #1846

fglock and others added 14 commits October 22, 2026 15:56
Add stable method and captured-closure benchmark anchors, enforce protocol
eligibility metadata, and cover benchmark calculations with Python unit tests.
Cache captured scalar cells by map identity and revision in the guarded
integer-addition closure path, with Perl-level rebinding coverage. Record the
current JFR diagnostic evidence and remaining acceptance work.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Randomize launch order with a recorded seed while balancing which engine starts
first. Allow the runner to compare a pinned PerlOnJava candidate JAR with an
exact reference JAR in the same process-pair protocol, and label those results
as attribution evidence rather than Perl parity.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Preserve the in-progress benchmark, workload, test, and documentation edits
before continuing the issue 1863 acceptance work.

Generated with Codex (https://openai.com/codex)
Co-Authored-By: Codex <158243242+codex@users.noreply.github.com>
Preserve the measured baseline, fast-path experiment, regression coverage,
and profiling artifacts before continuing optimization.

Generated with Codex (https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Cache stable hash-method overload eligibility per runtime and invalidate it
with bless and inline-method state. Recycle inline method argument arrays only
after compiler-proven non-escaping method calls. Add regression coverage for
dynamic hash-dereference overloads and escaped @_ arrays, and record paired
benchmark and JFR evidence.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Reuse call-local hash field cells after the guarded stable-method boundary has
validated them. Preserve checked lookups for ordinary calls. Record paired
method measurements against the exact origin artifact and pinned blead.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Reuse the exact argument and hash-field proof established by the method call
boundary when entering a compiler-proven stable-hash method. Keep the existing
generic checks for calls without an active matching proof. Record method and
full portfolio comparisons plus the post-change JFR profile.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Suppress root snapshot reachability work while a compiler-proven stable method
uses its non-escaping argument array. Restore normal tracking before generic
fallback and on exceptional exits. Keep the guard limited to small private
method arrays and record paired full-portfolio and origin-artifact evidence.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Consolidate stable-method argument checks with the active runtime and avoid
no-op @isa validation calls for inline argument lists. Preserve the same
runtime shape, overload, cell, and integer checks. Record current-artifact
method and full-portfolio comparisons with JFR evidence.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Skip normal mutation bookkeeping when recycling an inline argument list whose
root tracking was suppressed only for a compiler-proven non-escaping method.
Keep the ordinary clear path for all other arrays and protect package roots.
Exercise repeated calls with changing argument values in the stable-method test.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Record the complete diagnostic blead portfolio and paired exact-origin method
comparison for cc2d615, including artifact hashes and the macOS priority
limitation. Preserve the raw measurement windows and per-pair logs.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Keep fresh scalar results from stable hash mutation methods without the
additional scalar result detachment, guarded by runtime context and shape.
Add a focused regression test and a pinned portfolio workflow for issue
1863 attribution and Perl parity measurements.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
The pinned seven-pair comparison against the exact PR parent did not show a
reproducible gain for this fast path. Remove the optimization and its focused
test while retaining the issue 1863 benchmark workflow.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
fglock and others added 12 commits October 23, 2026 19:17
Keep the thread-local map entry when borrowing a recycled method argument
array so returning it updates the existing entry instead of allocating a new
ThreadLocalMap entry on each call. Add regression coverage for cleared array
reuse and record the hosted baseline findings in the performance design doc.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Record the exact-baseline workflow, the verified thread-local allocation
improvement, current blead ratios, and next profiling and memory gates.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Capture a short method anchor profile on the verified-priority runner before
scored measurements. Include execution samples, allocation samples, summary,
and process log in the existing issue 1863 artifact.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Run the pinned measurement workflow for commits pushed to its dedicated
performance branch and derive exact parent/master refs from push metadata.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Keep the stable hash and array-backed method guards from both sides of the
RuntimeCode conflict. Correct the unscored JFR step to drive the persistent
method-anchor worker for the requested recording duration.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Widen the immutable integer scalar cache to cover common method workload
results and avoid repeated RuntimeScalar allocations for those values.
The initial hypothesis is based on the hosted method-anchor JFR profile.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
The exact-parent hosted comparison measured method throughput at 0.976x
(95% interval 0.968–0.983) and portfolio throughput at 0.971x
(0.955–0.986). Return to the previous bounded cache.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Add the current master artifact as a direct optimized-blead comparison so
master's baseline has its own paired measurements and summary row.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Keep the recycled method argument array in a per-thread pool holder so
borrowing and returning it do not rewrite the ThreadLocal value on each call.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
The candidate-versus-parent portfolio interval crossed 1.0, so retain the
previous implementation until a measurable improvement is demonstrated.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
Reuse the guarded method's hash-cell pair while its backing map and bindings
remain stable. Map mutations invalidate the cache; exposed mutable views and
less common mutator APIs disable it. Add focused cache invalidation tests.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
The exact-parent paired run measured method throughput at 0.967x with a
95% interval of 0.937-0.999. Remove this regression and its cache-specific
tests while retaining the existing Perl-level method regression coverage.

Generated with OpenAI Codex (https://openai.com/codex)
Co-Authored-By: OpenAI Codex <223556219+openai-codex[bot]@users.noreply.github.com>
@fglock
fglock force-pushed the perf/issue-1863-throughput branch 3 times, most recently from b5338ac to f179d46 Compare October 25, 2026 03:41
fglock and others added 11 commits October 25, 2026 04:59
Avoid entering MyVarCleanupStack.popMark when a method call did not add
lexical registrations. Preserve the existing walk whenever registrations
were added during the call.

Generated with [Codex](https://openai.com/codex)

Co-Authored-By: Codex <codex@openai.com>
Preserve the current local optimization candidate before further profiling.

Generated with OpenAI Codex (https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
Use the existing int constructor for dynamic integer results that fit the
native 32-bit range, and cover writable method return values above the cache.

Generated with OpenAI Codex (https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
Rely on method argument recycling to clear verified hash fields on success,
and keep exception cleanup in the call boundary. Avoid a redundant cache clear
before validating each stable method call.

Generated with OpenAI Codex (https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
Record the ineligible local method-anchor attempt, pair logs, and updated
acceptance-plan status without presenting the result as parity evidence.

Generated with OpenAI Codex (https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
Record the complete seven-pair method comparison with verified priority,
paired interval, host load, and raw worker data. Keep the result separate from
full-portfolio acceptance.

Generated with OpenAI Codex (https://openai.com/codex)

Co-Authored-By: OpenAI Codex <openai-codex@users.noreply.github.com>
Reuse validated hash field cells across stable method calls when the receiver
map has not changed. Track ordinary map writes, and disable this cache when
mutable views or bypass mutators are exposed. Keep checked lookups as fallback.
Add tests for map revision tracking and cache invalidation behavior.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Track removals through the RuntimeHash values view while preserving cacheability
for read-only iteration. Keep entry/key views and untracked Map mutators on the
checked-lookup fallback. Test that iterator removal advances the revision.

Generated with Codex (https://openai.com/codex/)
Co-Authored-By: Codex <codex@openai.com>
Port the validated stable-hash cell cache and method argument fast paths to
PR #1870. Track hash mutations and exposed map views before reusing cached
field cells, and cover argument aliasing, pool reuse, and priority verification.
Archive the source-matched 14-pair blead portfolio.

Generated with Codex (https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Move default SBOM and Joni packaging checks to Gradle/Groovy, and make
Perl-only oracle and generator checks opt-in. Keep Python benchmark checks
available through their explicit target.

Generated with Codex (https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
Explain that Gradle supplies the Groovy runtime and document that Python
and Perl are optional for the default build and unit-test gate.

Generated with Codex (https://openai.com/codex/)

Co-Authored-By: Codex <codex@openai.com>
@fglock
fglock marked this pull request as ready for review October 26, 2026 09:33
@fglock
fglock merged commit c18cde5 into master Oct 26, 2026
2 checks passed
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.

perf: close method-call throughput gap to blead Perl

1 participant