|
Message-ID: <20150604031447.GA25336@brightrain.aerifal.cx>
Date: Wed, 3 Jun 2015 23:14:47 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: posix_spawn vs fork+exec test program
The attached test program can be used to measure the performance of
posix_spawn vs fork+exec under simulated memory conditions in the
parent. The options it takes are:
-n bytes memory to allocate
-r fragment memory into alternating ro/rw vmas
-d dirty allocated memory
-f use fork+exec (instead of default posix_spawn)
At -n 200000000 -r -d, I've observed a nearly 300x performance
difference.
As (somewhat) expected, with large -n but neither -r or -d, fork+exec
performs well -- all pages are COW zero pages and easily forked. But
if the pages are dirty, or if there are lots of vmas (even non-dirty
ones), fork gets very slow.
Rich
View attachment "spawntime.c" of type "text/plain" (1753 bytes)
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.