Skip to content

perf: elide discarded postfix scalar results - #1424

Closed
fglock wants to merge 1 commit into
masterfrom
perf/void-postincrement-20260918
Closed

fglock wants to merge 1 commit into
masterfrom
perf/void-postincrement-20260918

Conversation

@fglock

@fglock fglock commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • emit the prefix mutation operation for postfix ++/-- whose result is discarded in JVM void context
  • retain normal postfix behavior in value context
  • add coverage for integer, string, undef, decrement, tied, overloaded, and value-context behavior

Validation

  • perl src/test/resources/unit/void_postfix_increment.t (standard Perl): pass
  • make: pass (18 tasks, 6m49s)
  • make check-links: pass (683 links, zero errors)

Performance evidence

Two independently interleaved, normal-priority, fresh-process String screens against source-matched 72a2b43f0 measured candidate/parent median throughput ratios of:

  • 1.2088x
  • 1.2793x

The raw per-window JSON is retained under /tmp/perf-void-postincrement-string-ab{1,2}-highpower-20260918 on the measurement host. JFR confirms the intended mechanism: baseline samples in postAutoIncrement become preAutoIncrement in void context. This is focused evidence only, not a whole-portfolio parity claim.

Emit the equivalent prefix mutator for postfix increment and decrement in
true void context. The old-value scalar cannot be observed there, so this
avoids allocating it while preserving value-context postfix behavior.

Add Perl-level coverage for native, string, undef, tied, overloaded, and
value-context postfix behavior.

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

Co-Authored-By: Codex <codex@openai.com>
@fglock

fglock commented Sep 22, 2026

Copy link
Copy Markdown
Owner Author

Superseded by #1486.

@fglock fglock closed this Sep 22, 2026
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