csvread 3.0.1 exponentially slower than v 3.0.0

John W. Eaton jwe at bevo.che.wisc.edu
Thu Jul 10 10:56:04 CDT 2008


On 10-Jul-2008, David Bateman wrote:

| The change between the two versions was essentially to change the
| C-string handling to C++ string handling. It also more correctly
| duplicates the Matlab interface. This was done for this codes inclusion
| in Octave itself.

It looks like there was more than that in going from revision 4585 (a
version attributed to Kai Habel) to 4605 (a version attributed to
Jonathon Stickel).  In the current version, I think the problem is
that the output matrix is resized each time a new row is encountered
(or, if a line has more columns than are currently in the matrix).
For the example file provided, that means approximately 180000 calls
to resize, with most of these just adding three elements to the
matrix.  I think we need something better than that...  I don't have
time to work on it at the moment, but would consider a patch.

jwe


More information about the Bug-octave mailing list