Preload not working?

Hello,
does anyone feel that the “preload” daemon actually does anything? I was hoping to speed up Firefox launch, but did not think it made any difference. In fact, if include

       services.preload.enable = true; 
       systemd.services.preload.serviceConfig.EnvironmentFile = [ (
            pkgs.writeText "preload" ''
                    PRELOAD_OPTS="--verbose 9 -d"
                '') ];

in my config, I only ever get

Nov 26 17:34:25 duality preload[43551]: persistent state stats:
Nov 26 17:34:25 duality preload[43551]: preload time = 168310
Nov 26 17:34:25 duality preload[43551]: num exes = 0
Nov 26 17:34:25 duality preload[43551]: num bad exes = 0
Nov 26 17:34:25 duality preload[43551]: num maps = 0
Nov 26 17:34:25 duality preload[43551]: runtime state stats:
Nov 26 17:34:25 duality preload[43551]: num running exes = 0
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] state log dump done
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] state scanning end
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] state predicting begin
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] 154150kb available for preloading, using 0kb of it
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] nothing to readahead
Nov 26 17:34:25 duality preload[43551]: [Wed Nov 26 17:34:25 2025] state predicting end
Nov 26 17:34:35 duality preload[43551]: [Wed Nov 26 17:34:35 2025] state updating begin
Nov 26 17:34:35 duality preload[43551]: [Wed Nov 26 17:34:35 2025] state updating end

in journalctl -ef preload, so it either doesn’t appear to see or decides not to preload any processes.

1 Like

Never heard of preload. Looking at it, it was last updated in 2009. I doubt it’s actually useful nowadays, especially with significantly faster hardware & more optimized software. You mentioned you wanted Firefox to load faster, how slow is it starting up? For me, it takes no more than a couple seconds.

The nix package is from 2 years ago, I didn’t notice the release is from 2009. Using preload is recommended in a few places around the web. I’m not sure if it’s relevant with SSDs anymore but was still confused that it just doesn’t appear to do anything.

Regarding Firefox, yes it takes 2-3 seconds but on Windows it’s almost instant and it’s a little annoying because I’m using it so often. One thing I found using strace is that it appears to spend almost 1 second enumerating fonts. I had installed the full google-fonts package, removing that/cutting it down to only the needed ones speeds up things considerably. Now if I can figure out why it spends almost as much time in the icon paths, I’ll be almost there.

Edit: moved the “not working” discussion to the issue tracker: preload: Not doing anything? · Issue #465407 · NixOS/nixpkgs · GitHub #465407