From 1f8b85786eed623319e5c71a5341b15e3006f870 Mon Sep 17 00:00:00 2001 From: eldritch horrors Date: Mon, 18 Mar 2024 12:38:49 +0100 Subject: libutil: remove vfork MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- src/libutil/util.hh | 1 - 1 file changed, 1 deletion(-) (limited to 'src/libutil/util.hh') diff --git a/src/libutil/util.hh b/src/libutil/util.hh index ed4c8705a..34ac33349 100644 --- a/src/libutil/util.hh +++ b/src/libutil/util.hh @@ -413,7 +413,6 @@ struct ProcessOptions std::string errorPrefix = ""; bool dieWithParent = true; bool runExitHandlers = false; - bool allowVfork = false; /** * use clone() with the specified flags (Linux only) */ -- cgit v1.2.3