29 Jul 2025 |
John Ericson | Mic92 Sergei Zimmerman (xokdvium) OK yeah firefox parses 4 times slower | 20:39:21 |
Sergei Zimmerman (xokdvium) | In reply to @Ericson2314:matrix.org Mic92 Sergei Zimmerman (xokdvium) OK yeah firefox parses 4 times slower So doing the lazy thing is worth it certainly. | 20:40:10 |
John Ericson | OK! | 20:40:17 |
John Ericson | Sergei Zimmerman (xokdvium): I wonder if I should use mutable since it is morally pure | 20:41:03 |
John Ericson | not good for concurrency const | 20:41:13 |
Mic92 | In reply to @Ericson2314:matrix.org Mic92: any idea where we would get a nice meaty real-world structured attrs derivation? Anything in stdenv has to be parsed/generated multiple times. Bootstrapping in general takes most of the time in any eval flamegraph I have seen so far. | 20:41:19 |
John Ericson | but is good for "are we changing it?" const | 20:41:21 |
Mic92 | So this Code makes parsing 4x slower? https://github.com/NixOS/nix/commit/7f0ff4957e634de8aa2edb3cac5e79375c605148 | 20:46:04 |
Mic92 | Surprising because the throughput of our current parser is slower than what I expect a JSON parser to be able to pull off. | 20:47:48 |
Mic92 | * Surprising because the throughput of our current derivation parser is slower than what I expect a JSON parser to be able to pull off. | 20:48:04 |
John Ericson | Mic92: oh wait tbh I was doing unoptimized builds | 20:51:13 |
John Ericson | that doesn't mean much | 20:51:19 |
John Ericson | I opened up https://github.com/NixOS/nix/issues/13573 regardless | 20:57:19 |
John Ericson | since we can make GC faster by not parsing the entire derivation | 20:57:28 |
John Ericson | OK optimized before
BM_ParseRealDerivationFile/hello 6814 ns 6791 ns 104081 bytes_per_second=247.735Mi/s
BM_ParseRealDerivationFile/firefox 31529 ns 31420 ns 22281 bytes_per_second=486.429Mi/s
| 21:18:01 |
John Ericson | BM_ParseRealDerivationFile/hello 6952 ns 6929 ns 102364 bytes_per_second=242.772Mi/s
BM_ParseRealDerivationFile/firefox 71569 ns 71292 ns 9695 bytes_per_second=214.381Mi
| 21:18:27 |
John Ericson | optimized after | 21:18:29 |
John Ericson | 4x to 2x | 21:18:39 |
John Ericson | not good enough | 21:18:42 |
Mic92 | In reply to @Ericson2314:matrix.org I opened up https://github.com/NixOS/nix/issues/13573 regardless Is it not all the store references we care about in those derivations, not just outpaths? | 21:22:57 |
John Ericson | Mic92: I think it is just looking to keep derivations pointing to live store paths? | 21:23:25 |
John Ericson | I could be wrong | 21:23:33 |
Mic92 | https://github.com/NixOS/nix/blob/b062730665d120088ab6c3e154b4545f95d2fa4b/src/libstore/gc.cc#L767 | 21:26:42 |
Mic92 | Ah but wait this for keepOutputs | 21:31:24 |
Mic92 | This is not the same as keep derivations, no? | 21:31:55 |
John Ericson | Mic92: I am talking about the queryOutput stuff in there | 21:35:18 |
John Ericson | Mic92: oh wow, it's already done via the database in the local store case! | 21:37:58 |
John Ericson | see queryStaticPartialDerivationOutputMap | 21:38:03 |
John Ericson | https://github.com/NixOS/nix/issues/13573#issuecomment-3134157257 | 21:40:17 |
John Ericson | so....why the hell is it so slow? | 21:40:23 |