Skip to content

regex: perex 0.1.15 + section views, 32-regex -11% instructions - #13427

Merged
proggeramlug merged 22 commits into
mainfrom
runtime-regex-slice3
Oct 28, 2026
Merged

proggeramlug merged 22 commits into
mainfrom
runtime-regex-slice3

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Oct 28, 2026 •

Copy link
Copy Markdown
Contributor

Regex slices 2+3 (beat-scriptc lane R1): Perry-side adapters plus perex 0.1.15 from crates.io (released today: PerryTS/perex#7, borrow validated program sections per active VM view, chain repeated-atom phases, borrow class predicates; no format, semantic or work-charge change, no owning cache, no per-pattern native code).

  • 32-regex, 6 interleaved ABBA pairs on one core pair vs current main: instructions -11.04% (range -11.05..-11.03), cycles -11.9% (every pair lower). Still ~12x scriptc in instructions; R1 stays open.
  • Startup (exact callgrind Ir, x86-64-v3, symbols, ASLR off, 3 identical runs per arm), main -> head: hello 142,012 -> 142,012; commander 21,283,987 -> 21,198,823; commander --help 23,671,683 -> 23,583,084; fastify 165,114,154 -> 164,561,155; Richards 43,046,459 -> 42,828,826. An earlier Richards memcmp +32,761 (string payload moved near a page end) is fixed in the product with bounded equality + inline key adapters.
  • Regex semantics: the strict 12,593-case Node reference keeps exactly the 3 pre-existing Unicode differences, which follow ECMA-262 (recorded as Node deviations; no oracle changes). js-compiled 22/22, regex 11/11; CLI 1310, gcaudit regex/string/canonical/keys suites; Windows both modes.
  • Dependency: perex = "0.1.15", crates.io source and checksum (eb3fdad6...); no git or path override.

Summary by CodeRabbit

  • Performance

    • Improved string-key comparisons, reducing overhead when looking up object properties.
    • Reduced regular-expression processing overhead, particularly for patterns with repeated atoms.
  • Compatibility

    • Regular-expression results, capture behavior, and work limits remain unchanged.

Ralph Küpper added 21 commits October 27, 2026 19:32
# Conflicts:
#	crates/perry/src/commands/compile/compile_env.rs
#	crates/perry/src/commands/compile/optimized_libs/tests.rs
@coderabbitai

coderabbitai Bot commented Oct 28, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Caution

Review failed

The pull request is closed.

Walkthrough

This change upgrades workspace Perex to 0.1.15 and adds a bounded byte-slice equality helper for runtime property-key comparisons. Canonical-key and lookup scans use the helper. Tests cover alignments, mismatches, and protected page boundaries.

Changes: Property-key byte comparisons

Layer / File(s) Summary
Add and expose bounded key comparison
crates/perry-runtime/src/string/compare/key_equal.rs, crates/perry-runtime/src/string/compare.rs, crates/perry-runtime/src/string/mod.rs, crates/perry-runtime/src/string/compare/keys.rs, changelog.d/13427-jrx-startup.md
A crate-visible helper compares equal-length byte slices using bounded unaligned reads. Tests cover varied alignments, mismatches, and protected page boundaries. The changelog describes the property-key comparison change.
Use helper in key comparisons
crates/perry-runtime/src/object/canonical_keys.rs, crates/perry-runtime/src/object/keys_lookup.rs
Canonical-key matching and ordinary, descriptor-resolved, and namespace-filtered lookup scans use the helper for byte-slice comparisons.

Perex dependency update

Layer / File(s) Summary
Upgrade Perex and record release changes
Cargo.toml, changelog.d/13427-jrx-vm.md
The workspace dependency changes from Perex 0.1.14 to 0.1.15. The changelog describes borrowed validated sections, chained repeated-atom VM phases, and behavior stated as preserved.

Priority: Not assessed

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Refactor

Possibly related PRs

  • PerryTS/perry#12792: Both changes update Perry’s Perex regex integration, and this PR follows the Perex 0.1.14 dependency used in that work.
Merge Risk: Minimal · up to 4eb88

The change is mergeable after normal checks; no actionable merge-blocking risk was identified.

Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@proggeramlug
proggeramlug marked this pull request as ready for review October 28, 2026 13:33
@proggeramlug
proggeramlug merged commit 96e7e3f into main Oct 28, 2026
98 of 102 checks passed
@proggeramlug
proggeramlug deleted the runtime-regex-slice3 branch October 28, 2026 13:38
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