Skip to content

Use memchr for comment slash searches - #34

Open
charliermarsh wants to merge 1 commit into
charlie/ohm-fmt-reuse-file-handlesfrom
charlie/codex-fmt-memchr
Open

charliermarsh wants to merge 1 commit into
charlie/ohm-fmt-reuse-file-handlesfrom
charlie/codex-fmt-memchr

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Use memchr for the slash checks introduced in #33. Text containing / still uses the existing comment lexer.

Against #33, an edited uv cargo fmt -p uv took 0.86% less time across 80 accepted pairs on two devboxes (99% CI: 0.33–1.48%). Both hosts improved; 13 further pairs were excluded for host contention. The comparison used the same compiler, Cargo #176, and PGO inputs, and produced identical formatted output.

This measures the patch on #33 before restacking; adding the dependency also relinked cargo-fmt.

@charliermarsh
charliermarsh added this pull request to stack #26 October 21, 2026 21:26
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Oct 22, 2026
We prepare Ohm 1.99.0-8 with faster incremental formatting: verified
module rewrites avoid whole-crate work, snapshot and parse state are
reused, and comment scanning skips text without slashes.

We pin [rustfmt #34](astral-experiments/ohm-rustfmt#34)
and [Rust #200](astral-experiments/ohm-rust#200), which
synchronizes the formatter’s new `memchr` dependency with the compiler
workspace lockfile. Cargo, Clippy, and bundled upstream Wild keep their
published pins. The optimizations guide is updated separately in #151
for review.
@charliermarsh
charliermarsh removed this pull request from stack #26 November 2, 2026 15:37
@charliermarsh
charliermarsh added this pull request to stack #55 November 2, 2026 15:37
@charliemarsh-oai
charliemarsh-oai removed this pull request from stack #55 November 8, 2026 15:14
@charliermarsh
charliermarsh removed this pull request from stack #77 November 9, 2026 15:59
@charliermarsh
charliermarsh added this pull request to stack #82 November 9, 2026 15:59
@charliermarsh
charliermarsh force-pushed the charlie/codex-fmt-memchr branch from 3c9620c to 5cd73db Compare November 17, 2026 05:22
@charliermarsh
charliermarsh removed this pull request from stack #82 November 17, 2026 05:26
@charliermarsh
charliermarsh added this pull request to stack #84 November 17, 2026 05:26
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