Skip to content

deps(regex): take perex 0.1.10; ready for the perex#3 matcher release - #11548

Draft
proggeramlug wants to merge 2 commits into
mainfrom
perf/regex-perex-adopt
Draft

proggeramlug wants to merge 2 commits into
mainfrom
perf/regex-perex-adopt

Conversation

@proggeramlug

@proggeramlug proggeramlug commented Sep 27, 2026 •

Copy link
Copy Markdown
Contributor

Draft. Blocked on a perex release that contains PerryTS/perex#3, and on that release clearing the 7-day min-publish-age soak. This PR is ready to receive that version bump.

Part of #10166

What it does today:

  • Moves Perry from perex 0.1.9 to 0.1.10. 0.1.10 was published 2026-09-20 and has cleared the soak.
  • Adapts to 0.1.10's one API change. Search::run now returns RunError { error, remaining_work, buffers }, so both call sites in perex_runtime.rs record the work a failed run left instead of keeping the entry budget. That retires the "under-counts what the failed call spent" caveat those sites carried. Nothing observes it today, because WORK is usize::MAX on these paths.

The step still missing is perex = "0.1.11" (or whichever release carries perex#3), which brings the matcher changes measured below. Nothing else in Perry changes for it.

What the perex#3 matcher changes do in Perry

Measured on qb2 (AMD EPYC 9254, idle), --release, PERRY_NO_AUTO_OPTIMIZE=1. The perex#3 branch is built in through a local [patch.crates-io] path. Both arms sit on top of #11543, and the only difference between them is the perex source plus this adaptation. Instructions come from perf stat -e instructions:u as a two-N differential.

Package workloads (scripts/package_bench.py run --arms node,perry --modes instr). Every Perry run's output was byte-identical to Node 26.5.1:

workload node before with perex#3 Δ
jsonwebtoken/decode 34,850 233,972 112,469 −51.9%
uuid/v4 6,556 63,660 33,225 −47.8%
uuid/v7 18,331 101,423 71,090 −29.9%
uuid/v5_parse 48,301 251,964 191,072 −24.2%
nanoid/generate 2,884 68,670 55,080 −19.8%
dotenv/parse 203,214 2,948,837 2,877,221 −2.4%
decimal.js/parse_sum 1,722,290 43,623,719 42,867,092 −1.7%
node-cron/validate_parse 427,893 4,357,781 4,284,555 −1.7%
validator/batch 957,163 28,593,841 28,303,073 −1.0%
moment/parse_format 115,070 3,899,511 3,879,889 −0.5%
date-fns/format_add 85,895 1,166,059 1,163,517 −0.2%
commander/parse_argv 193,121 4,024,680 4,038,212 +0.3%
dayjs, date-fns/diff_interval, validator/sanitize within ±0.1%

Microbenchmarks, instructions per call:

probe before with perex#3 Δ
uuid REGEX.test (/^(?:[0-9a-f]{8}-…)$/i) 23,500 8,227 −65.0%
jws JWS_REGEX.test, 155-char token 96,711 15,395 −84.1%
/^\d+$/.test 4,453 4,164 −6.5%
dotenv LINE.exec loop, 36-line document 1,609,579 1,559,671 −3.1%
split(/%..|./) 166,370 166,526 +0.1%

Peak RSS (median of 5, harness n2) moves by less than 1% on every workload measured except moment/parse_format, which is −6.1%. The matcher allocates nothing new; its scratch is unchanged.

Tests (qb2, with the perex#3 patch)

  • cargo test --release -p perry-runtime --lib -- perex split replace regex (RUST_TEST_THREADS=1): 274 passed.
  • run_parity_tests.sh (PERRY_SKIP_BUILD=1 PERRY_NO_AUTO_OPTIMIZE=1) with filters regex, regexp, split, replace, match, against Node 26.5.1: 65 PASS, plus the same pre-existing COMPILE_FAIL main has (test_gap_regex_replace_dyn_regex_with_http).
  • test-files/test_gap_regex_engine_package_shapes.ts (added in perf(regex): cut split and replace host overhead on ASCII subjects #11543) is byte-identical to Node with the patch.
  • perex#3 has its own full check list: cargo test in debug and release, every differential harness including q1/q17 pausing and relocation, and test262.

Run on this branch as pushed, with perex 0.1.10 from the registry: cargo test --release -p perry-runtime --lib -- perex split replace regex (RUST_TEST_THREADS=1), 274 passed. Not run with 0.1.10: the gap filters. The adaptation is the same code that passed them against the patched perex. Also not run: the full gap sweep, the auto-optimize arm, macOS, and cargo test --workspace.

perex 0.1.10's `Search::run` fails with `RunError { error, remaining_work,
buffers }`. Both call sites in `perex_runtime.rs` now set the budget from the
failed run's remaining work, where they used to keep the entry budget and
under-count what the failed call spent. Nothing observes that today, since
WORK is usize::MAX on these paths.

This is the adaptation the perex release carrying PerryTS/perex#3 (the
package-shaped repeat and class fast paths) needs. Taking that release is then
a version bump.
@coderabbitai

coderabbitai Bot commented Sep 27, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

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

Copy link
Copy Markdown
Contributor Author

perex 0.1.11 is published (crates.io, tag v0.1.11, commit 80845f531 = perex#3 merged + version bump). It clears Perry's 7-day publish-age soak around 2026-10-04 21:40Z. Then this PR only needs the version bump from 0.1.10 to 0.1.11 and a re-measure. Measured with perex#3 patched in locally on top of #11543: jsonwebtoken decode −52%, uuid v4 −48%, v7 −30%, v5 parse −24%, nanoid −20%, RSS within 1%.

This branch has not been deployed

No deployments
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