Skip to content

perf: curate guarded string and closure gains - #1387

Merged
fglock merged 13 commits into
masterfrom
perf/curated-parity-gains
Sep 15, 2026
Merged

fglock merged 13 commits into
masterfrom
perf/curated-parity-gains

Conversation

@fglock

@fglock fglock commented Sep 15, 2026

Copy link
Copy Markdown
Owner

Summary

Curates two independently guarded compiler/runtime improvements from the
performance research branch without merging its experimental history:

  • use a direct scalar result for a proven, captured-integer closure addition;
  • retain the general BMP substring-offset scan and small negative-literal
    lowering paths.

The branch intentionally does not include the benchmark-shaped plain-hash
method specialization. The retained changes preserve the ordinary fallback for
unsupported, observable, debugger, lvalue, overflow, taint, and overload
cases.

Validation

  • System-Perl and focused JVM/interpreter closure and method safety coverage
    passed (recorded in dev/design/performance-delivery-selection.md).
  • Full immutable make passed at 21081cf4b, rebased onto current master
    300954833 (/tmp/make-perf-curated-rebase-300954833-20260915.log).
  • Markdown link validation passed after the evidence refresh.

Performance evidence and scope

Earlier source-matched seven-pair portfolio artifacts have matching semantic
checksums, but their analyzer marked them inconclusive because of host load and
warmup instability. This PR therefore makes no portfolio-wide throughput or
Perl-parity claim. The selection manifest preserves the artifacts and their
qualification. A fresh stable-host portfolio is required before any such claim.

Follow-up

String, Regex, and Life remain below the parity objective. Future method work
will target broadly shared costs—argument-frame allocation, cached dispatch,
scalar-result handling, and hash access—rather than recognizing a particular
method implementation.

Related benchmark tooling is in #1295 and remains a separate PR.

fglock and others added 13 commits September 15, 2026 16:00
Port the retained BMP substring offset scan and integer literal unary-minus
lowering from performance research, with permanent Perl regressions and the
delivery-selection manifest for the remaining closure and method groups.

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

Co-Authored-By: Codex <noreply@openai.com>
Add the retained closure and method semantic regressions, including a
PadWalker capture-rebind case that any direct closure entry must preserve.
Record the validation evidence and minimal-port constraints in the delivery
selection manifest.

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

Co-Authored-By: Codex <noreply@openai.com>
Mark compiler-proven captured-scalar addition closures and bypass the ordinary
call boundary only for scalar, zero-argument native-integer invocations.
Preserve ordinary behavior for debugger, lvalue, overflow, tainted, overloaded,
and PadWalker-rebound cases.

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

Co-Authored-By: Codex <noreply@openai.com>
Record the integrated closure fast path and defer the two-slot method
recognizer in favor of investigating costs shared by ordinary methods.

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

Co-Authored-By: Codex <noreply@openai.com>
Record the source-matched pilot, matching tooling identities, and unstable host
conditions without treating its directional throughput as delivery evidence.

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

Co-Authored-By: Codex <noreply@openai.com>
Add the required work-in-progress changelog entry for the selected guarded
compiler performance improvements without making an unmeasured claim.

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

Co-Authored-By: Codex <noreply@openai.com>
Record the current-source control run, checksum validation, and the
non-authoritative interpretation of the curated portfolio.

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

Co-Authored-By: Codex <noreply@openai.com>
Distinguish the passing current-target correctness gate from the earlier
non-authoritative portfolio artifacts.

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

Co-Authored-By: Codex <noreply@openai.com>
Record the current master base and passing immutable validation gate without
transferring a throughput claim from the earlier inconclusive portfolio.

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

Co-Authored-By: Codex <noreply@openai.com>
Recycle tagged one-scalar return lists only after direct JVM call sites extract
their scalar result. Preserve ordinary list-context and multi-value result
lifetime, add return-context regression coverage, and record bounded closure
JFR allocation evidence.

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

Co-Authored-By: Codex <codex@openai.com>
Recycle the private one-scalar RuntimeList wrapper when compound assignment
scalarizes a subroutine or method result, without changing ordinary list
identity or call-frame ownership. Add a cross-backend regression and record
the allocation boundary and benchmark evidence in the performance handoff.

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

Co-Authored-By: Codex <codex@openai.com>
Route JVM coderef and method scalar-result conversions through the existing
private RuntimeList recycler. Add opt-in lifecycle counters that prove the
method hot path now recycles its scalar return wrappers, and record the
allocation evidence and measurement limits in the performance handoff.

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

Co-Authored-By: Codex <codex@openai.com>
Keep Perl's required scalar return copy, then mark only the private
one-element scalar-context wrapper for runtime-local recycling.

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

Co-Authored-By: Codex <noreply@openai.com>
@fglock
fglock merged commit 4a41ba4 into master Sep 15, 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.

1 participant