diff options
author | eldritch horrors <pennae@lix.systems> | 2024-03-18 12:38:49 +0100 |
---|---|---|
committer | eldritch horrors <pennae@lix.systems> | 2024-03-18 06:10:41 -0600 |
commit | 1f8b85786eed623319e5c71a5341b15e3006f870 (patch) | |
tree | 468641e1592d0cb73ad9fc562cbf0acdd258800f /src/nix/daemon.cc | |
parent | 2890840b962beb0a4108a27b262bf6a94490d10f (diff) |
libutil: remove vfork
vfork confers a large performance advantage over fork, measured locally
at 16µs per vfork agains 90µs per fork. however nix *almost always*
follows a vfork up with an execve-family call, melting the performance
advantage from 6x to only 15%. in most of those cases it's doing things
that are undefined behavior (like manipulating the heap, or even
throwing exceptions and trashing the parent process stack).
most notably the one place that could benefit from the vfork performance
improvement is linux derivation sandbox setup—which doesn't use vfork.
Change-Id: I2037b7384d5a4ca24da219a569e1b1f39531410e
Diffstat (limited to 'src/nix/daemon.cc')
-rw-r--r-- | src/nix/daemon.cc | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/nix/daemon.cc b/src/nix/daemon.cc index 42ce3b996..4f9907ad7 100644 --- a/src/nix/daemon.cc +++ b/src/nix/daemon.cc @@ -347,7 +347,6 @@ static void daemonLoop(std::optional<TrustedFlag> forceTrustClientOpt) options.errorPrefix = "unexpected Nix daemon error: "; options.dieWithParent = false; options.runExitHandlers = true; - options.allowVfork = false; startProcess([&]() { fdSocket = -1; |