!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

962 Members
For people hacking on the Nix package manager itself204 Servers

Load older messages


SenderMessageTime
7 Aug 2021
@tomberek:matrix.orgtomberek hrm... that would be super noisy with nixpkgs20:49:51
@tomberek:matrix.orgtomberek *

I think we can add an informative output any time there is no flake.lock for an input flake.

* Flake 'myflake' is not locked
* Updated 'myflake': ASDSAD -> ASDSADA"
21:06:48
8 Aug 2021
@Las:matrix.orgLas Wasn't Nix going to support storing Git repositories natively in /nix/store? I seem to remember an issue about it on https://github.com/NixOS/nix. 15:24:01
@derkha:matrix.orgKha joined the room.15:27:54
@tomberek:matrix.orgtomberek#1006 has discussion ^^^^15:31:47
@Las:matrix.orgLasThanks!15:32:33
@infinisil:matrix.orginfinisil removed their profile picture.22:48:52
9 Aug 2021
@manveru:matrix.orgmanveru i wonder if there's even a way to fix https://github.com/NixOS/nix/blob/master/src/libexpr/symbol-table.hh#L79 easily... maybe using std::unordered_set::count first to find the key without too many allocations and making life a bit easier for our GC? But of course that adds CPU overhead by doing the lookup twice... 08:47:22
@mic92:nixos.devMic92 manveru: what do you save this way? 12:13:14
@mic92:nixos.devMic92 * manveru: what do you safe this way? 12:13:22
@mic92:nixos.devMic92Ah constructing a string.12:13:37
@manveru:matrix.orgmanveruyeah :)12:13:43
@manveru:matrix.orgmanveruwould need to bench to see if it's worth it... just stumbled over it when reading the code12:14:08
@mic92:nixos.devMic92I was also trying to optimize the very same code yesterday12:14:25
@mic92:nixos.devMic92There are different hash table implementations one can use.12:14:41
@mic92:nixos.devMic92llvm also has a hash set specific to symbols that allocates strings within the hash table to save memory.12:15:08
@mic92:nixos.devMic92I guess a count should be cheaper than a malloc but maybe you can do the benchmark.12:16:08
@manveru:matrix.orgmanveruwell, i'd imagine a count won't allocate anything in the GC, so it should help for stuff like haskell.nix which has a ton of symbols afaik...12:20:46
@andi:kack.itandi- Why count over find? Do you fear the allocation an allocator might produce? count could probably be more costly than find that (should?) return on the first positive match. 12:40:15
@mic92:nixos.devMic92There are also other interesting hash tables. For example for pointer to pointer maps, a dense hash map is better.14:29:57
@andi:kack.itandi-We probably want to store only the ptr but sort/bucket them by a hash for the string value to make lookups fast(er)?15:54:12
@tim:stratum0.orgdadada (they/them) changed their display name from dadada to dadada (they/them).15:59:41
@andi:kack.itandi-I did a very unscientific benchmark of one version that uses unique_ptr and allocates only for new elements (AFAICT) and one that is basically what we have right now: https://quick-bench.com/q/BI8_-Nfg9dYrGBEwKR-0xm1QKw417:19:38
@andi:kack.itandi-BI8_-Nfg9dYrGBEwKR-0xm1QKw4.png
Download BI8_-Nfg9dYrGBEwKR-0xm1QKw4.png
17:19:54
@andi:kack.itandi-If you move the constructor / destructor of the table out of the loop it is 200 / 1100 in favor of the ptr approach.17:23:23
@andi:kack.itandi-The sad story is that this doesn't really seem to have an effect in practice :( It is +- 0.02 sec difference when evaling the Firefox test.17:47:32
@manveru:matrix.orgmanveru andi-: i'd love to try that with something a bit more GC heavy to see memory impact... i didn't expect much CPU difference 18:54:27
@andi:kack.itandi-But those Symbols aren't tracked by the GC? Otherwise we should set an allocator for them.18:55:10
@manveru:matrix.orgmanverui don't know how C++ works unfortunately :(18:55:47
@andi:kack.itandi-They are allocated once and stay there until the process terminates18:56:16

Show newer messages


Back to Room ListRoom Version: 6