Skip to content

perf: monch 0.6#33643

Merged
bartlomieju merged 8 commits into
denoland:mainfrom
dsherret:perf_monch_0_6
May 3, 2026
Merged

perf: monch 0.6#33643
bartlomieju merged 8 commits into
denoland:mainfrom
dsherret:perf_monch_0_6

Conversation

@dsherret
Copy link
Copy Markdown
Contributor

@bartlomieju bartlomieju marked this pull request as ready for review May 2, 2026 07:56
Copy link
Copy Markdown
Contributor

@fibibot fibibot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Bumps monch to 0.6 + deno_task_shell to 0.30 and switches five parser sites from char-level scans to byte-level take_while_byte / skip_while_byte where the delimiters are ASCII:

  • libs/npm/lib.rs:158–166parse_version on _ (ASCII)
  • libs/npmrc/ini.rs:78–80parse_section_header on ], \n
  • libs/npmrc/ini.rs:246skip_non_newline_whitespace on , \t
  • libs/npmrc/ini.rs:255skip_comment on \n
  • libs/npmrc/lib.rs:303env_var on }

Soundness check

Every delimiter byte the new code scans for (_, ], \n, , \t, }) is in the ASCII range 0x00–0x7F, which means it can never appear as a UTF-8 continuation byte (those are 0x80–0xBF). So a byte-level scan that stops at one of these bytes always halts on a valid char boundary, and the returned &str slice is guaranteed valid UTF-8 because the input &str already is. The comments at the relevant sites ("_ is ASCII so the byte-level scan halts on a valid char boundary", etc.) capture this correctly.

The if_not_empty(substring(skip_while(...)))take_while_byte(...) + empty check rewrite at parse_version is a behavior-preserving simplification — same semantics with one less intermediate combinator.

CI

All 63 of the relevant lint debug / test unit / test node_compat shards across 4 platforms × debug+release are SUCCESS. The 35 CANCELLED jobs and the lone ci status: FAILURE are downstream of an earlier-run cancellation cascade, not actual test failures — re-trigger cleans them up. 134 total green.

Small integration perf win as advertised in the PR body ("like a percent or two") plus the cleanup at libs/npm/lib.rs removing the // todo: improve monch to provide the error message without source TODO comment alongside the version bump.

deno_ast 0.53.2 now includes the error type name ("SyntaxError:") in
parse error messages. The previous fix commit updated the snippet
format but missed the SyntaxError: prefix on the first line of these
three .out files.
@bartlomieju bartlomieju merged commit 348bae7 into denoland:main May 3, 2026
136 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.

3 participants