[Xapian-tickets] [Xapian] #502: Use custom locking helper executable

Xapian nobody at xapian.org
Thu Dec 4 09:36:15 GMT 2014


#502: Use custom locking helper executable
---------------------------+----------------------------
 Reporter:  olly           |             Owner:  olly
     Type:  enhancement    |            Status:  closed
 Priority:  normal         |         Milestone:
Component:  Backend-Chert  |           Version:  1.2.2
 Severity:  normal         |        Resolution:  wontfix
 Keywords:                 |        Blocked By:
 Blocking:                 |  Operating System:  All
---------------------------+----------------------------
Changes (by olly):

 * status:  assigned => closed
 * resolution:   => wontfix
 * milestone:  1.3.3 =>


Comment:

 I did some timings on my current dev box, running Debian unstable which is
 reasonably close to what jessie will be, and testing on a spinning disk
 (though SSD didn't seem to make much difference when I compared).  For
 these I just ran simpleindex around 10 times, with instrumentation added
 to flintlock.cc (plus patches to implement each approach):

  * 11-40 us ''fcntl alone''
  * 12-40 us OFD
  * 13-66 us flock
  * 170-488 us fork/exec static cat helper
  * 185-335 us fork/exec dynamic cat helper
  * 190-380 us fork/fcntl/exec cat
  * 224-477 us fork/fcntl and loop on read rather than exec-ing /bin/cat:
  * 269-570 us vfork/exec static fat helper
  * 385-701 us vfork/exec dynamic fat helper
  * 383-858 us fork/exec static fat helper
  * 454-1006 us fork/exec dynamic fat helper

 The cat helper is a simple program which just reads and swallows stdin (so
 it behaves like {{{cat > /dev/null}}})

 The fat helper does all the things which we currently do in the child
 process between {{{fork()}}} and {{{exec()}}} (and the library then exec-s
 this helper right after {{{fork()}}}.

 The statically linked cat helper is surprisingly large - perhaps a
 cunningly written helper could avoid pulling in as much of libc, though I
 only call {{{write()}}} explicitly.

 I conclude from this that (at least on my hardware running a recent Linux
 kernel) there is no benefit at all from trying to be clever about the
 helper, and the benefits of using any custom helper are minimal, and not
 worth the extra complication involved.  Perhaps other platforms would
 benefit more, but OFD locking is clearly where we actually want to be.

 So I'm going to close this as "wontfix".

--
Ticket URL: <http://trac.xapian.org/ticket/502#comment:8>
Xapian <http://xapian.org/>
Xapian



More information about the Xapian-tickets mailing list