pysal/pysal — pull request #338 by jseabold (2013-09-09 19:04:42+00:00)
Title: ENH: Move Geary's C calculations to Cython.

Work in progress. Don't merge yet, and I'm in no particular hurry.

Is there any interest for moving some calculations to Cython? It does complicate the build process a bit, but once it's started you can roll other bottlenecks into it as well.

I benchmarked this on the test suite data for Geary and on a small-ish 100-400 observation problem I'm working on now. The former got a 25x speed-up the latter got around a 11x speed-up. Depending on the "usual" size assumptions, things can be optimized more in the Cython code. Usually handle small lists vs. medium-size and large lists/arrays a little differently because of overhead.

If there's interest, I can make the build a little more robust sometime this week. I.e., no checking in to git of .c files, they'd be generated at build time. That means to build from Github you need Cython. The .c files woud be included in source distributions, so that means a C compiler becomes necessary.

I'm generating nightly binary builds for windows of statsmodels, and could probably add pysal easily enough if this is a concern.