!VRULIdgoKmKPzJZzjj:nixos.org

Nix Hackers

898 Members
For people hacking on the Nix package manager itself187 Servers

You have reached the beginning of time (for this room).


SenderMessageTime
22 May 2025
@puck:puck.moepuck
In reply to @emilazy:matrix.org
(using scopedImport to catch readFile takes 1.5× longer to eval :( )
(scopedImport doesn't cache imports the way import does; this is maybe a pretty big reason for the slowdown?)
14:26:32
@emilazy:matrix.orgemilyhmm I'd somewhat hope Nixpkgs doesn't import the same files over and over but maybe that's optimistic14:27:11
@emilazy:matrix.orgemily indeed it is, sort -u goes from 6186 to 4003 14:28:18
@emilazy:matrix.orgemilywhich is precisely a ratio that explains the slowdown14:28:28
@emilazy:matrix.orgemilyI wonder if there's anything disgusting I can do to re-add the caching14:28:43
@emilazy:matrix.orgemily best idea I can immediately come up with is let imports = listToAttrs (map (filename: { name = filename; value = scopedImport env filename; }) enumerateEveryFileInNixpkgs); env = { import = filename: imports.${filename} or scopedImport env filename; …; }; or something 14:32:28
@emilazy:matrix.orgemilyand by best I mean horrible14:32:33
@emilazy:matrix.orgemilyconstant factors seem like they'd be brutal too14:32:43
@emilazy:matrix.orgemily the other thing is that I actually don't need to trace stuff in Nixpkgs… but I can't just avoid forwarding import = scopedImport env; to Nixpkgs, because Nixpkgs can import user code again (e.g. callPackage) 14:36:23
@emilazy:matrix.orgemily I guess I could override lib.callPackageWith and hope there's no other important cases :) 14:37:49
@sbc64:matrix.orgsbc64 joined the room.16:40:46
@philiptaron:matrix.orgPhilip Taron (UTC-8) Awesome news! Is there someone from the Nix core team on deck to make the nixpkgs PR, or would you like community support from (say) me there? 17:59:48

Show newer messages


Back to Room ListRoom Version: 6