Skip to content

Conversation

@Cheong-Lau
Copy link
Contributor

Since we already depend on rustc-hash transiently, this doesn't add any more dependencies. As long as DOS attacks aren't a concern (which I don't think they are?), this should be free performance.

In my (admittedly naive) testing, this really improved CPU usage in some cases, which is pretty nice to get for free.

Also, on a separate note, I would like to work on improving the performance more, but right now I don't actually know how to benchmark properly (cargo-flamegraph is returning nonsense for me?), so I've just been making random changes until performance improved. This is the first change I made that actually did anything meaningful 🫠

Since we already depend on `rustc-hash` transiently, this doesn't add
any more dependencies. As long as DOS attacks aren't a concern (which I
don't think they are?), this should be free performance.

In my (admittedly naive) testing, this really improved CPU usage in some
cases, which is pretty nice to get for free.
@mmstick
Copy link
Member

mmstick commented Oct 18, 2025

Are you able to use samply? Did you set debug = true on your release profile? Note that Debian packaging automatically strips debug symbols.

https://github.com/mstange/samply

@Cheong-Lau
Copy link
Contributor Author

Cheong-Lau commented Oct 18, 2025

Are you able to use samply?

I will check that out, thanks!

Did you set debug = true on your release profile?

Yeah, I was using the release-with-debug profile. cargo-flamegraph had a bunch of libc functions and didn't really have anything relevant to the Rust code I could see, so I'm not sure what's happening there. 😕
EDIT: maybe I wasn't giving perf the permissions it needed? hmm

@Cheong-Lau
Copy link
Contributor Author

@mmstick I got it working! Just needed to give perf the perms

Anyways, a quick benchmark opening a large folder (~2000 items)

Current main rustc-hash (this PR) rustc-hash + other random optimisations
~197 ms ~192 ms ~180 ms
current_main.json.gz rustc_hash.json.gz secret_sauce.json.gz

rustc-hash isn't really helping here, which is fair enough. It made the app feel snappier elsewhere, so I might benchmark something else later. But it means my other optimisations weren't for nothing! I'll keep working on them and open a new PR later.

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.

2 participants