rustup icon indicating copy to clipboard operation
rustup copied to clipboard

Reduce directory override lookup overhead during proxy startup

Open Kaileshwar16 opened this issue 2 weeks ago • 2 comments

overrides_by_dir() opens and keeps a handle for every saved directory override. I tried checking overrides one at a time and dropping each handle after comparison.

below i attached the benchmark for both release build through proxy using dumy rustc .

Overrides Current Temporary change
0 5.2 ms 5.5 ms
10 5.4 ms 5.4 ms
50 5.5 ms 5.5 ms
100 13.1 ms 5.7 ms
200 23.3 ms 5.9 ms
500 35.0 ms 6.7 ms
1,000 46.8 ms 8.2 ms

with 100 overrides and a 64-file-descriptor limit, the current code also missed a matching override. the temporary change selected it correctly.

this change still compares directory identity using filesystem handles, preserving the behavior introduced in #5113.

is it reasonable to do it?

Kaileshwar16 avatar Nov 21 '26 08:11 Kaileshwar16

https://github.com/rust-lang/rustup/pull/5232

djc avatar Nov 21 '26 09:11 djc

mb did not taken a look at it :( i worked on older checkout

Kaileshwar16 avatar Nov 21 '26 09:11 Kaileshwar16