[bind10-dev] quick performance comparison: dnspython vs BIND10 python binding

JINMEI Tatuya / 神明達哉 jinmei at isc.org
Thu Mar 25 06:39:39 UTC 2010


For killing spare time in Anaheim, I've written some simple python
script using both dnspython and BIND10's python binding with C++
backend.  It's a simple DNS "server" that listens on an IPv4 UDP port
and returns a pre-populated "authors.bind/TXT/CH' response after some
minimal level checks on incoming messages.

I've measured performance of these simple programs in terms of maximum
qps using queryperf.  The results are:
- dnspython: about 1200qps
- BIND10 python binding: about 6200qps

I don't know how to interpret these results.  It's not surprising that
BIND10 is faster than dnspyhon because actual DNS protocol processing
is written in C++ while dnspython is a pure-python package (in fact,
if BIND10 weren't much faster than dnspyon I'd be very disappointed).
What I'm not sure is how fast it should be.  But "5 times as fast"
doesn't seem to be bad.

Other notes about the comparison:
- python versions are different: (my) dnspython uses python 2.6, and
  BIND10 uses python 3.1
- code logic in the BIND10 version was a bit optimized: It uses the
  same DNS message" object for both parsing and rendering, and reuses
  the same object for all queries.  The dnspython version creates a
  new message object for every query, and creates a separate message
  object for each response.  I disabled this minor optimization for
  BIND10 and measured its performance.  The resulting qps was about
  5700qps.

For reference I've uploaded the scripts at:
http://bind10.isc.org/~jinmei/authors-python/
(the BIND10 version hardcodes a file path in my local environment so
it won't work in other environments)

---
JINMEI, Tatuya



More information about the bind10-dev mailing list