Skip to content

perf: fast-path native integer modulus - #1436

Open
fglock wants to merge 3 commits into
masterfrom
perf/native-integer-modulus-20260917
Open

fglock wants to merge 3 commits into
masterfrom
perf/native-integer-modulus-20260917

Conversation

@fglock

@fglock fglock commented Sep 18, 2026

Copy link
Copy Markdown
Owner

Summary

  • Fast-path % when both operands are ordinary, non-wide native integers.
  • Retain the existing path for tied, overloaded, string, floating-point, and wide-integer operands.
  • Add magic-boundary regression coverage and record current delivery evidence.

Validation

  • System-Perl-focused coverage and JVM/interpreter coverage passed before revalidation.
  • Exact rebased candidate: make passed at nice +19 (/tmp/make-native-integer-modulus-current-20260918.log).
  • Production-load, seven-pair master/candidate comparisons had matching checksums and all warmups stabilized:
    • Numeric: +1.5% median.
    • Life: +2.9% median; 6/7 pairs positive.
    • String guard: +1.3% median.

The measurements support this focused runtime improvement. They are not a claim of whole-portfolio Perl-parity acceptance.

fglock and others added 3 commits September 18, 2026 23:34
Skip overload lookup and numeric coercion when both modulus operands already
have plain native-integer representations. Preserve the existing slow paths
for objects, strings, doubles, and wide integers.

Add system-Perl-validated coverage for result signs, large integers, the
numeric benchmark recurrence, and warning behavior.

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

Co-Authored-By: Codex <codex@openai.com>
Exercise tied scalar FETCH and overloaded percent dispatch so ordinary
integer fast paths remain excluded from observable magic behavior.

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

Co-Authored-By: Codex <158243242+openai-codex[bot]@users.noreply.github.com>
Record the current-master production comparisons and semantic scope for the
native-integer modulus delivery candidate.

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

Co-Authored-By: Codex <codex@openai.com>
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