tvl-depot/src/libutil
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
..
affinity.cc Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
affinity.hh Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
archive.cc * Revert r15436. This was a workaround for a bug in btrfs which seems 2010-05-04 12:42:58 +00:00
archive.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00
hash.cc If hashes do not match, print them in base-32 for SHA-1/SHA-256 2012-10-23 18:05:50 +02:00
hash.hh If hashes do not match, print them in base-32 for SHA-1/SHA-256 2012-10-23 18:05:50 +02:00
Makefile.am Run the daemon worker on the same CPU as the client 2013-08-07 14:02:04 +02:00
md5.c * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
md5.h * Some Cygwin fixes. 2006-05-24 13:23:20 +00:00
md32_common.h * Add SHA-256. 2005-01-14 12:03:04 +00:00
serialise.cc Process stderr from substituters while doing have/info queries 2013-06-07 15:02:14 +02:00
serialise.hh Process stderr from substituters while doing have/info queries 2013-06-07 15:02:14 +02:00
sha1.c * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
sha1.h * Optional switch "--with-openssl=<PATH>" to use OpenSSL's 2006-02-13 19:52:43 +00:00
sha256.c * Add SHA-256. 2005-01-14 12:03:04 +00:00
sha256.h * FreeBSD 4.x doesn't have stdint.h, use inttypes.h instead (which is 2005-05-04 16:32:54 +00:00
types.hh Include config.h before any other header 2012-09-11 14:45:42 -04:00
util.cc killUser: Don't let the child kill itself on Apple 2013-07-30 21:25:16 +02:00
util.hh Garbage collector: Don't follow symlinks arbitrarily 2013-07-12 14:03:36 +02:00
xml-writer.cc XML writer: flush after newlines 2012-10-04 14:07:36 -04:00
xml-writer.hh Use "#pragma once" to prevent repeated header file inclusion 2012-07-18 14:59:03 -04:00