[Nix-dev] Why Nix-0.16 so hungry on ressources (mem + cpu) ?

Eelco Dolstra e.dolstra at tudelft.nl
Mon Oct 31 17:45:37 CET 2011


Hi,

On 10/30/2011 10:55 PM, Lluís Batlle i Rossell wrote:

> On the sheevaplug, 512MB of physical RAM, and the same amount of swap:
> 7.88user 0.71system 0:09.86elapsed 87%CPU (0avgtext+0avgdata 617568maxresident)k
> 0inputs+0outputs (4major+41841minor)pagefaults 0swaps
> 
> I think Eelco thinks there is a bug in 'time' about the remort of memory,
> showing something 4-times bigger or so on some systems. Maybe we have something
> bad about page-size in headers/kernel?

I've looked into this and it turns out to be a bug in ‘time’.  I've applied a fix.

FWIW, here are my stats (on a 64-bit machine):

$ command time nix-env -i hello --dry-run
0.72user 0.21system 0:00.96elapsed 97%CPU (0avgtext+0avgdata 352008maxresident)k

$ GC_INITIAL_HEAP_SIZE=100000 command time nix-env -i hello --dry-run
1.46user 0.08system 0:01.57elapsed 98%CPU (0avgtext+0avgdata 104540maxresident)k

$ command time nix-env -f ~/Dev/nixpkgs -iA hello --dry-run
0.07user 0.01system 0:00.10elapsed 82%CPU (0avgtext+0avgdata 13388maxresident)k

$ GC_INITIAL_HEAP_SIZE=100000 command time nix-env -f ~/Dev/nixpkgs -iA hello
--dry-run
0.08user 0.01system 0:00.11elapsed 81%CPU (0avgtext+0avgdata 12736maxresident)k

$ command time nix-instantiate /etc/nixos/nixos -A system --readonly-mode
1.00user 0.10system 0:01.11elapsed 99%CPU (0avgtext+0avgdata 243636maxresident)k

$ GC_INITIAL_HEAP_SIZE=100000 command time nix-instantiate /etc/nixos/nixos -A
system --readonly-mode
1.34user 0.04system 0:01.39elapsed 99%CPU (0avgtext+0avgdata 64544maxresident)k

So NixOS system evaluation can run in 63 MiB.

-- 
Eelco Dolstra | http://www.st.ewi.tudelft.nl/~dolstra/


More information about the nix-dev mailing list