lix/src/libstore
Eelco Dolstra a583a2bc59 Run the daemon worker on the same CPU as the client
On a system with multiple CPUs, running Nix operations through the
daemon is significantly slower than "direct" mode:

$ NIX_REMOTE= nix-instantiate '<nixos>' -A system
real    0m0.974s
user    0m0.875s
sys     0m0.088s

$ NIX_REMOTE=daemon nix-instantiate '<nixos>' -A system
real    0m2.118s
user    0m1.463s
sys     0m0.218s

The main reason seems to be that the client and the worker get moved
to a different CPU after every call to the worker.  This patch adds a
hack to lock them to the same CPU.  With this, the overhead of going
through the daemon is very small:

$ NIX_REMOTE=daemon nix-instantiate '<nixos>' -A system
real    0m1.074s
user    0m0.809s
sys     0m0.098s
2013-08-07 14:02:04 +02:00
..
build.cc Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
derivations.cc Only substitute wanted outputs of a derivation 2012-11-26 17:15:09 +01:00
derivations.hh Only substitute wanted outputs of a derivation 2012-11-26 17:15:09 +01:00
gc.cc Garbage collector: Don't follow symlinks arbitrarily 2013-07-12 14:03:36 +02:00
globals.cc Disable the copy-from-other-stores substituter 2013-06-20 12:01:33 +02:00
globals.hh Revert "Prevent config.h from being clobbered" 2013-03-08 01:24:59 +01:00
local-store.cc Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
local-store.hh Don't keep "disabled" substituters running 2013-06-20 11:55:15 +02:00
Makefile.am Add builtin constants ‘langVersion’ and ‘nixVersion’ 2012-11-27 13:29:55 +01:00
misc.cc Don't substitute derivations that have preferLocalBuild set 2013-06-20 19:26:31 +02:00
misc.hh Don't set $preferLocalBuild and $requiredSystemFeatures in builders 2013-06-20 18:07:27 +00:00
optimise-store.cc Revert "Prevent config.h from being clobbered" 2013-03-08 01:24:59 +01:00
pathlocks.cc Set the close-on-exec flag on file descriptors 2012-03-05 20:29:00 +01:00
pathlocks.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
references.cc Use data() instead of c_str() where appropriate 2012-02-09 18:27:45 +01:00
references.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
remote-store.cc Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
remote-store.hh nix-store -q --roots: Respect the gc-keep-outputs/gc-keep-derivations settings 2012-12-20 18:41:44 +01:00
schema.sql * Store the size of a store path in the database (to be precise, the 2010-11-16 17:11:46 +00:00
store-api.cc Garbage collector: Don't follow symlinks arbitrarily 2013-07-12 14:03:36 +02:00
store-api.hh nix-store --export: Export paths in topologically sorted order 2013-05-23 14:55:36 -04:00
worker-protocol.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00