Skip to content

perf: avoid utf8 conversion when appending extensions#218

Draft
hardfist wants to merge 1 commit into
mainfrom
perf/unix-extension-buffer
Draft

perf: avoid utf8 conversion when appending extensions#218
hardfist wants to merge 1 commit into
mainfrom
perf/unix-extension-buffer

Conversation

@hardfist
Copy link
Copy Markdown
Contributor

Summary

Split out the first resolver micro-optimization from #215.

This keeps extension probing on Unix in OsStr byte form when appending configured extensions, avoiding a lossy UTF-8 string conversion on the normal file-extension lookup path.

Measurement

Measured previously against exact Callgrind for:

benches/resolver.rs::resolver::bench_resolver::resolver[single-thread]

Baseline: 116,917,041 Ir
After this change: 116,554,214 Ir
Delta: -362,827 Ir (-0.31%)

Artifact from the original measurement run:

optimization-artifacts/valgrind/callgrind/20260517T043726Z-single-thread-unix-extension-buffer/

Validation

cargo clippy --all-features -- -D warnings
cargo test --lib -- --skip tests::pnp

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 18, 2026

Merging this PR will not alter performance

✅ 12 untouched benchmarks


Comparing perf/unix-extension-buffer (d488231) with main (8975e38)

Open in CodSpeed

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