help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Slowness in function 'open'


From: John W. Eaton
Subject: Re: Slowness in function 'open'
Date: Thu, 21 Jun 2007 20:37:19 -0400

On 21-Jun-2007, Mark B. wrote:

| Does anybody else know how to improve these times?

Maybe.

As others have pointed out, if you need a quick fix for your problem,
you could use a filter of some kind to convert your data to binary.

Another option that I don't think I've seen mentioned yet is to filter
your data so that it is prefixed with a header that looks like this:

  # name: x
  # type: matrix
  # rows: 100000
  # columns: 1

(with the name and dimensions of your matrix substituted, of course).
Then I think Octave's load function will be able to read the file
faster.

Or, if you are interested in improving this bit of poor performance so
that everyone benefits, the functions you are looking for are in
src/ls-mat-ascii.cc.  The function that reads rows and columns of
numbers may be trying too hard to ensure that all rows have the same
number of columns and to also counting the number of non-comment lines
before it actually reads the data (so it can avoid resizing the output
matrix, possibly multiple times).

jwe


reply via email to

[Prev in Thread] Current Thread [Next in Thread]