add derivation parser benchmark#13569
Conversation
|
So this line is expensive: nix/src/libutil/file-system.cc Line 158 in 47f5e5f And this function is hot: nix/src/libstore/derivations.cc Line 192 in 47f5e5f This is what I did in rust: https://github.com/Mic92/nix-diff-rs/blob/bd5d3d2ba4470b3b4a9acddcd0d5ba9968235416/src/parser.rs#L181 What is the equivalent of memchr2 in C++? |
| description : 'Build language bindings (e.g. Perl)', | ||
| ) | ||
|
|
||
| option( |
There was a problem hiding this comment.
Looks like this option is not the right approach w.r.t. componentized builds? It works in a devshell only.
There was a problem hiding this comment.
Maybe add the option only to the subprojects that have benchmarks and make that option yield?
There was a problem hiding this comment.
I could move benchmarks to its own subprojects maybe? Or we just always build them but not run them.
There was a problem hiding this comment.
I could move benchmarks to its own subprojects maybe
Not sure if it's warranted for now. Can we stick with just 2 options: in libstore-tests and the top-level file, and the one in libstore-tests with yield: true.
Or we just always build them but not run them.
Not a huge fan, because we'd have an unconditional dep on gbenchmark in nixpkgs.
There was a problem hiding this comment.
Or we just always build them but not run them.
Not a huge fan, because we'd have an unconditional dep on gbenchmark in nixpkgs.
Does the componentized build help here? We would always build the benchmarks, but we don't have to run time, and the thing users actually install won't depend on them.
There was a problem hiding this comment.
We would always build the benchmarks, but we don't have to run time, and the thing users actually install won't depend on them.
Makes sense, yeah. I suppose introducing configurability isn't a top priority here.
There was a problem hiding this comment.
I think we can merge this now, and maybe then consider removing the flags.
a0f1e70 to
a625739
Compare
the current identified bottlenecks are parseString in derivations.cc and dirOf (because of std::filessystem creation).
|
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/getting-started-with-optimizing-the-nix-project/67342/1 |
xokdvium
left a comment
There was a problem hiding this comment.
Very good start. Very excited about improved tooling. We can improve on it in follow-ups.
the current identified bottlenecks are parseString in derivations.cc and dirOf (because of std::filessystem creation).