[cfe-commits] r172900 - /cfe/trunk/bindings/python/clang/cindex.py

Sean Silva silvas at purdue.edu
Sat Jan 19 08:07:19 PST 2013


On Sat, Jan 19, 2013 at 6:03 AM, Tobias Grosser
<grosser at fim.uni-passau.de> wrote:
> This is a very performance critical point for auto completion. The manual
> implementation gives a large speedup. As it does not complicate the code a lot,
> I figured it is worth the change. If anybody understands why the CachedProperty
> is here so much slower, I am very interested in working on an improvement of
> CachedProperty.

It's possible that it has to do with the fact that the decorator
causes at least one extra Python function call, which is one of the
more expensive operations in CPython. The built-in `property` is coded
in C (in python/Objects/descrobject.c).

Unfortunately this scenario means that you probably won't be able to
get equivalent performance from a pure-Python solution (in CPython)
without doing something very nasty; pypy possibly won't have this
problem.

-- Sean Silva



More information about the cfe-commits mailing list