[Nix-dev] Re: Performance impact of Nix
Ludovic Courtès
ludo at gnu.org
Sun Aug 9 17:37:24 CEST 2009
Hello!
ludo at gnu.org (Ludovic Courtès) writes:
> In a recent discussion, Ralf Wildenhues [0] rightfully wondered about
> the performance impact of Nix' file system layout and/or that of the
> symlink indirection in profiles.
I did a quick experiment with the attached Guile script (run as "sudo
guile test-symlink.scm"), which shows these timings for stat(2) of a
regular file vs. stat(2) of a symlink pointing to that file:
* regular file
clock utime stime cutime cstime gctime
1.14 0.74 0.38 0.00 0.00 0.21
* symlink
clock utime stime cutime cstime gctime
1.46 0.86 0.59 0.00 0.00 0.30
Here it's 28% slower to stat(2) a symlink that to stat a plain regular
file.
I'm not sure how much can be extrapolated from this result, but it's
probably safe to say that symlinks do add noticeable overhead.
As for possible solutions, I don't have any idea. Hard links won't work
across file systems, and it's not obvious that some unionfs would
perform better. (GNU/Hurd has "firm links", which would be handy
here...)
Thanks,
Ludo'.
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test-symlink.scm
Url: http://lists.science.uu.nl/pipermail/nix-dev/attachments/20090809/15a89251/attachment.pl
More information about the nix-dev
mailing list