[pylucene-dev] PyLucene no longer uses SWIG

Andi Vajda vajda at osafoundation.org
Thu Mar 30 10:32:14 PST 2006


On Thu, 30 Mar 2006, ogjunk-pylucene at yahoo.com wrote:

> Excellent.  We'll be changing information about PyLucene in the upcoming Lucene in Action 2.0 edition then.
> How is the performance now comapred to the SWIG version?

It depends. If the amount of work performed by the actual Java Lucene API is 
minimal, then the new code is quite a bit faster. If the work is significant, 
then it is a drop in the bucket. For example, instantiating Java's Object 
class should represent a pretty minimal amount of work and python's timeit 
module reports:

> python -m timeit "from PyLucene import Object" "Object()"
    with SWIG: 10 loops, best of 3: 32.9 usec per loop
without SWIG: 10 loops, best of 3: 13.1 usec per loop

>From that it would mean that crossing the python to C++/Java barrier can be 
over twice as fast. Seriously, I wouldn't read too much into these timings 
unless you're in a very tight loop making lots of calls to very cheap APIs.

Andi..


More information about the pylucene-dev mailing list