nu11ptr/PyInstanceVars — pull request #2 by dendright (2013-02-19 11:33:27+00:00)
Title: Performance gain by dynamically compiling function

A solution which in effect writes the boiler plate code the user wants to avoid by using `@instancevars`. This solution is more performant, being 1.4 times slower than explicit, vs 4-5 before.

I have only tested this in CPython 2.7

> $ python instancevars_bench.py
> The microseconds per iteration for '@instancevars' was: 5.9204
> The microseconds per iteration for explicit init. was: 4.1341
> Explicit vars are 1.4321 times faster than using '@instancevars'