[Xapian-devel] Database Locking

Olly Betts olly at survex.com
Thu May 26 17:50:27 BST 2005


On Thu, May 26, 2005 at 03:37:06PM +0100, Olly Betts wrote:
> On Thu, May 26, 2005 at 02:44:06PM +0100, Olly Betts wrote:
> > Here are some preliminary timings for a successful lock and unlock on
> > x86_64 Linux (I timed 10000 iterations using "time"):

Running a 2.6 kernel, incidentally.

> >  98.4-175.2 us   Quartz style locking with a lock file
> > 533.2-605.6 us   fork/fcntl/exec locking
> >   8.1-10.4  us   fnctl alone
>   224.4-318.7 us   fork/fcntl and loop on read rather than exec-ing /bin/cat
>   443.3-506.8 us   fork/fcntl and exec our own helper rather than /bin/cat

Ooh, using our own statically linked helper seems a good idea:

    231.3-305.5 us   fork/fcntl and exec our own statically linked helper

I've just tried the same tests on an SMP x86 Linux 2.2 box, and the
order is the same but the differences more marked.  The new scheme is 5
times slower, but we're still talking about 0.5ms.  Using /bin/cat is 15
times slower than Quartz there!

Cheers,
    Olly




More information about the Xapian-devel mailing list