Speed up PySNMP for Free? (Upgrade to Python 2.6, apparently...)


Apparently there *is* going to be some performance changes in CPython (though it's from the PyPy folks, so I suppose the "most of the recent performance-oriented work happens in PyPy" analysis stands). There's a patch that adds an __mro__ function cache. This is a pretty straightforward operation that caches the function-object lookup on types via a global lookup function.

The patch is seen having 5% speedup on generic code, but as much as 25% on code bases with lots of deep inheritance. PySNMP is probably the most extreme example of deeply nested hierarchies I've seen lately (think 20-30 classes in most object's mro), and when we benchmarked it to speed it up we were consistently seeing the time spent in method lookup for the classes.

Anyway, will be interesting to see if it makes as big a difference in PySNMP as it seems it should. I don't think it would give us a 10x speedup, but it might give us a nice "free" scale-up.

Comments

Comments are closed.

Pingbacks

Pingbacks are closed.