scipy/scipy — pull request #519 by pv (2013-04-20 17:57:07+00:00)
Title: ENH: io/matlab: avoid making copies of zlib compressed data when loading files

The Matlab IO code makes some unnecessary copies of the data when loading files with compressed data. This PR changes the code so that it avoids making any copies --- loading 1 GB of compressed data requires now roughly 1 GB of memory.

Closes [Trac #1894](http://projects.scipy.org/scipy/ticket/1894) (note that the test file supplied by the user there is malformed --- do something like `python2.7 -c 'import numpy as np; from scipy.io import savemat; x=np.zeros([int(500e6/8)]); savemat("foo.mat", dict(x=x), do_compression=1)'` to generate a test file.)