[SciPy-Dev] sparsetools C++ code size

Pauli Virtanen pav at iki.fi
Wed Mar 5 10:44:21 EST 2014


Ralf Gommers <ralf.gommers <at> gmail.com> writes:
> In preparing the beta I've run into a practical issue.
> My build machine is not my regular (linux) one but an
> old one running OS X 10.6 - needed for the Mac binaries -
> with 1 Gb of RAM. I just figured out that it's basically
> impossible to compile the SWIG-generated C++ sparsetools
> code with it. This is due to the source code size more than
> doubling (see below) and everything just grinding to a halt
> when it hits the first sparsetools extension (csr_wrap.cxx).

There are two possible causes:

- template instantiation over many type permutations
- the crazy C++ wrapper code SWIG generates

My guess would be on the latter. The .cxx source file sizes
are completely crazy, and contain *only* Python wrapping code.
The code that does the actual computations is in the .h files.

It is certainly possible to do the wrapping much tighter by
just writing the code manually.

I wouldn't go rewriting sparsetools in templated C, as it is
not clear that this would be any superior to C++ template
instantiation.

-- 
Pauli Virtanen




More information about the SciPy-Dev mailing list