Skip to content

Reduce formatter path-resolution overhead on Linux - #27

Open
charliermarsh wants to merge 1 commit into
charlie/1.98/ohm-fmt-single-pass-writesfrom
charlie/codex-uv-fmt-overhead
Open

charliermarsh wants to merge 1 commit into
charlie/1.98/ohm-fmt-single-pass-writesfrom
charlie/codex-uv-fmt-overhead

Conversation

@charliermarsh

@charliermarsh charliermarsh commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Canonicalizing paths while recording and validating the formatter cache requires many filesystem lookups. On Linux, use openat2 to check absolute paths without symlinks in one lookup. Relative paths, parent components, symlinks, and unsupported kernels fall back to standard canonicalization.

In a syscall profile of an edited uv cargo fmt -p uv, readlink calls fell from 20,314 to 1,117. Across 40 accepted pairs, median time fell from 1.631 s to 1.525 s, with a paired reduction of 5.8% (99% CI: 4.3–7.2%). Two further pairs were excluded for host contention. Both builds used the same compiler, Cargo #176, and PGO inputs, and produced identical formatted output.

@charliermarsh
charliermarsh added this pull request to stack #26 October 21, 2026 11:50
@charliermarsh
charliermarsh marked this pull request as ready for review October 21, 2026 12:49
charliermarsh added a commit to astral-experiments/ohm that referenced this pull request Oct 21, 2026
Restore Linux release builds by downloading checksum-pinned LLVM 23.1.2
from its GitHub release; the apt.llvm.org BOLT package has been removed.
Extract only BOLT's tools and runtimes so we continue to use Rust's
matching `llvm-profdata`.

Update the unpublished 1.99.0-7 Rust pin to include the rustfmt
dependency integration fix in astral-experiments/ohm-rust#199. This keeps the
compiler workspace lockfile valid when release builds overlay
astral-experiments/ohm-rustfmt#27.
@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-uv-fmt-overhead branch from 5af2f95 to 4c57467 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