Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Performance optimisation #236

Open
SuperSandro2000 opened this issue Sep 29, 2023 · 0 comments
Open

Performance optimisation #236

SuperSandro2000 opened this issue Sep 29, 2023 · 0 comments

Comments

@SuperSandro2000
Copy link
Member

I generated a flame graph with the help of https://www.justanotherdot.com/posts/profiling-with-perf-and-dhat-on-rust-code-in-linux.html and the nix-index database from https://github.com/nix-community/nix-index-database .

One thing you notice immediately is that we spend a lot of the time (43.5%) on decoding the highly compressed zstd. Maybe lowering the compression level from 22 (!) to some more default value like 9 can already increase performance with only small database increases.

My general idea with this is to kickoff performance optimisations to make nix-index faster when using as a command-not-found replacement.

profile

 ▶ time target/release/nix-locate bin/hello
......

real    0m1.545s
user    0m1.375s
sys     0m0.150s
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

No branches or pull requests

1 participant