[haiku-commits] Change in haiku[master]: libroot: Implement the general case of posix_spawn using load_image.

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 28 Aug 2019 04:58:01 +0000

From waddlesplash <waddlesplash@xxxxxxxxx>:

waddlesplash has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/1752 ;)


Change subject: libroot: Implement the general case of posix_spawn using 
load_image.
......................................................................

libroot: Implement the general case of posix_spawn using load_image.

The goal here is to avoid potentially expensive fork()ing.

The time for a fork() is (for a process with no real heap usage
and thus few areas) 300-400us on my system. load_image() takes
3000us (3ms) or so, but this of course includes exec() time.

Overall, for compiling HaikuDepot (with a tweaked jam to use
posix_spawn on Haiku, not just on Linux) there is a slight
decrease in time:

before:
real 1m21.727s
user 1m2.131s
sys  0m43.029s

after:
real 1m19.472s
user 1m1.752s
sys  0m41.740s

Which is probably within the realm of "noise", so more benchmarks
are needed. Likely if we tweak our jam usage to not need as many
shells when running commands, this would be a much more noticeable
change.
---
M headers/private/libroot/libroot_private.h
M src/system/libroot/os/image.cpp
M src/system/libroot/posix/spawn.cpp
M src/system/libroot/posix/unistd/exec.cpp
4 files changed, 121 insertions(+), 48 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/52/1752/1
--
To view, visit https://review.haiku-os.org/c/haiku/+/1752
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I217f2476b1ed9aa18322b3c2bc8986571d89549a
Gerrit-Change-Number: 1752
Gerrit-PatchSet: 1
Gerrit-Owner: waddlesplash <waddlesplash@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: libroot: Implement the general case of posix_spawn using load_image. - Gerrit