[Xapian-tickets] [Xapian] #502: Use custom locking helper executable
Xapian
nobody at xapian.org
Wed Aug 4 13:07:58 BST 2010
#502: Use custom locking helper executable
---------------------------+------------------------------------------------
Reporter: olly | Owner: olly
Type: enhancement | Status: new
Priority: normal | Milestone: 1.2.x
Component: Backend-Chert | Version: 1.2.2
Severity: normal | Blockedby:
Platform: All | Blocking:
---------------------------+------------------------------------------------
Here I noted that exec-ing our own custom statically linked helper
executable instead of /bin/cat was quite a bit faster:
http://article.gmane.org/gmane.comp.search.xapian.devel/519
However we never got around to doing that.
It's just occurred to me that there's an additional little win to be had
in this case, at least on some platforms - if we have our own helper, we
can move work like the closing of file descriptors to after the exec() and
use vfork() instead of fork(). There's not a huge saving to be had from
vfork() on a modern OS, but it can still be more efficient - for example:
http://www.netbsd.org/docs/kernel/vfork.html
On some platforms, vfork() may just be an alias for fork(), but there's no
penalty to doing the work in the child that I can see, and it may still be
a small win not to minimise modifications to pages shared with the parent.
It also means close-on-exec file descriptors get closed for us, which may
be more efficient.
Marking as 1.2.x as this is ABI and API compatible.
--
Ticket URL: <http://trac.xapian.org/ticket/502>
Xapian <http://xapian.org/>
Xapian
More information about the Xapian-tickets
mailing list