cuspaceflight/tawhiri — pull request #41 by danielrichman (2014-07-06 23:05:18+00:00)
Title: Cython can't cdef closures

... this amounts to ~10% (.5ms out of 7ms) speedup on the dev server. It makes a lot of `cython -a` white; compare

http://predictor-scratch.cusf.co.uk/daniel/cython-noclosures/without.html (notably ~line 84)

with

http://predictor-scratch.cusf.co.uk/daniel/cython-noclosures/with.html

... where I have finally achieved my goal of only having yellow where we are forced to interact with Python objects; everything else is clear.

The other side of the tradeoff is readability, I guess. It introduces an essentially useless class. When compiled, it's basically what I wanted a cdef closure to be under the hood: a struct with a couple of pointers, and statically typed methods that take the struct as the first argument.