I build my entire userspace software stack from source (not nix), and I disable Python eggs for that same reason, sys.path bloat. I am always horrified at how much overhead is revealed running a program under strace/dtruss/truss.
As long as there isn't one, perhaps I can pile on some wishes.
Typescript managed to add type checking javascript with .d files that add type annotations to all executables that specify acceptable arguments, environment variables, and which files and network addresses will be required access to.
In the age of agents, all apps need to be wrapped in a sandbox that limits where they can exfiltrate data to. And such a typed specification for executables could give an early fail if the application needs more than is allowed.
We could add an "all dependencies are immutable" flag to every app, but in an ideal world, I'd rather have a filesystem that caches content fingerprints and invalidates them on writes.
I don't see how this addresses the problem in the post, since the software is still going to make a bunch of unnecessary lookups. I'm also distrustful in general of a "cache all the things" approach to inefficiencies in software.
One example I gave over X: have applications emit configuration files to the store rather than a hidden door directory. XDG_CONF is the FHS model! Updating a setting should just create a new derivation and point to it.
The post describes several inefficiencies, including redundant dependency lookups, but also one that's computationally expensive and particularly friendly to caching:
aws --version for instance re-reads and hashes 869 source files
I don't see all software becoming Nix-aware anytime soon. If we're asking upstream developers to make changes, I think it's an easier sell if users outside the Nix ecosystem can benefit too.
Linux's IMA already caches file hashes internally. It would be nice to have something similar exposed as a general-purpose API.
munksgaard | 16 hours ago
@fzakaria is on a hell of a streak at the moment.
fazalmajid | 15 hours ago
I build my entire userspace software stack from source (not nix), and I disable Python eggs for that same reason, sys.path bloat. I am always horrified at how much overhead is revealed running a program under strace/dtruss/truss.
laat | 3 hours ago
I was hoping for a big reveal with a solution.
As long as there isn't one, perhaps I can pile on some wishes.
Typescript managed to add type checking javascript with
.dfiles that add type annotations to all executables that specify acceptable arguments, environment variables, and which files and network addresses will be required access to.In the age of agents, all apps need to be wrapped in a sandbox that limits where they can exfiltrate data to. And such a typed specification for executables could give an early fail if the application needs more than is allowed.
fzakaria | 3 hours ago
It was more of a call to action; if I had the solution for every package I would have announced it ;)
tomas | 13 hours ago
We could add an "all dependencies are immutable" flag to every app, but in an ideal world, I'd rather have a filesystem that caches content fingerprints and invalidates them on writes.
dkl | 9 hours ago
I don't see how this addresses the problem in the post, since the software is still going to make a bunch of unnecessary lookups. I'm also distrustful in general of a "cache all the things" approach to inefficiencies in software.
fzakaria | 8 hours ago
Caching is only on thing.
I think you can rethink way more.
One example I gave over X: have applications emit configuration files to the store rather than a hidden door directory. XDG_CONF is the FHS model! Updating a setting should just create a new derivation and point to it.
tomas | 8 hours ago
The post describes several inefficiencies, including redundant dependency lookups, but also one that's computationally expensive and particularly friendly to caching:
I don't see all software becoming Nix-aware anytime soon. If we're asking upstream developers to make changes, I think it's an easier sell if users outside the Nix ecosystem can benefit too.
Linux's IMA already caches file hashes internally. It would be nice to have something similar exposed as a general-purpose API.