Sender | Message | Time |
---|---|---|
31 Jul 2024 | ||
adisbladis | https://github.com/nix-community/emacs-overlay/issues/391 could be addressed by registering the unpacked elpa hashes instead | 04:07:31 |
linj | In reply to @adis:blad.isThe benefit of embedding recipes seems small to me. About the disadvantage, replacing a hash with the encoded content of a recipe increases the size of Nixpkgs. Recently, there are discussion about the size of Nixpkgs. Another thing is that it makes it harder to override the recipe. There is only one of these overrides in the current Nixpkgs so this is not a big issue I guess. | 05:44:55 |
linj | In reply to @adis:blad.is* The benefit of embedding recipes seems small to me. About the disadvantage, replacing a hash with the encoded content of a recipe increases the size of Nixpkgs. Recently, there are discussion about the size of Nixpkgs. Another thing is that now melpaBuild is used in almost all manual packages, so that use case should be supported, too. | 05:46:44 |
linj | * The benefit of embedding recipes seems small to me. About the disadvantage, replacing a hash with the content of a recipe increases the size of Nixpkgs. Recently, there are discussion about the size of Nixpkgs. Another thing is that now melpaBuild is used in almost all manual packages, so that use case should be supported, too. | 05:48:20 |
linj | * The benefit of embedding recipes seems small to me. About the disadvantage, replacing a hash with the content of a recipe increases the size of Nixpkgs. Recently, there are discussions about the size of Nixpkgs. Another thing is that now melpaBuild is used in almost all manual packages, so that use case should be supported, too. | 05:48:37 |
linj | turns out the increased size should not be a big issue: 0.43MB - 0.30MB = 0.13MB | 05:59:39 |
linj | In reply to @adis:blad.isYeah, we can use fetchzip for tarballs to get a unchanged hash. However, then we have to tar them again because elpaBuild wants tarballs. | 06:06:29 |
linj | I think generating nix code instead of JSON adds unnecessary complexity. The first motivation of code generation is about performance. That was 2015 though. Things probably have changed. Are there any benchmarks about this? The second motivation is to do override , which the current code of updating MELPA shows that it can be done without code generation. https://github.com/nix-community/emacs2nix/issues/4 | 06:17:24 |
adisbladis | In reply to @me:linj.techAgreed. Parsing/evaluating Nix code is slower than the equivalent json/toml export. | 07:18:59 |
adisbladis | I haven't benchmarked this difference in ages and don't have numbers on it. But it's by quite a margin. | 07:19:52 |
magic_rb | So a JSON file will parse and load quicker than the exact same thing in Nix syntax? | 07:22:38 |
linj | I guesst usually JSON needs to be loaded and transformed to be the exact thing to generated nix code | 07:25:27 |
linj | * I guesst the case where JSON needs to be loaded and transformed to be the exact thing to generated nix code is more interesting | 07:26:07 |
linj | In reply to @me:linj.techThere is a pr for R to switch from code gen to JSON: https://github.com/NixOS/nixpkgs/pull/328272 . The performance overhead is very small. | 07:39:48 |
adisbladis | In reply to @magic_rb:matrix.redalder.orgYes. Some of that is faster parsing, some of that is strictness (json/toml values aren't thunked afaik) | 07:46:55 |
adisbladis | I'll make a micro benchmark, gimme a minute | 07:47:38 |
adisbladis | Loading & adding 500k numbers from a json & nix file respectively (
| 07:51:14 |
magic_rb | Now i wonder if a subset of nix, unsafeImportStrict could be created. Essentially treating nix code like json and erroring on anything non json like, functions and let bindings | 07:56:35 |
magic_rb | Because json is really hard to read | 07:56:48 |
adisbladis | Ideally TOML should be readable too, but it's a lot slower than either nix or json for the same task | 08:31:21 |
adisbladis | Conversely I also think we should have a builtins.importJSON /builtins.importTOML that doesn't need to readFile the whole contents | 08:32:31 |
adisbladis | In reply to @magic_rb:matrix.redalder.orgNot sure why that would be any more unsafe than the non-strict import equivalent? | 08:33:18 |
magic_rb | In reply to @adis:blad.isBecause it expects a .nix file but cant fully read it, not sure, maybe a separate nixjson format would be better | 08:42:31 |
adisbladis | Jesus christ | 08:44:00 |
adisbladis | Why is the Nix TOML decoding so slow | 08:44:10 |
adisbladis | I never actually knew how slow it is | 08:44:24 |
Philip Taron (UTC-8) | In reply to @adis:blad.isI'd love to see the perf result | 19:01:05 |
1 Aug 2024 | ||
adisbladis | In reply to @philiptaron:matrix.org
| 00:06:11 |
Philip Taron (UTC-8) | Yikes! | 00:15:00 |
adisbladis | Indeed! Tbf though these files are much larger than your typical ones. | 00:17:19 |