octave-maintainers
[Top][All Lists]
Advanced

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

Re: C++ version of regexprep.cc


From: John W. Eaton
Subject: Re: C++ version of regexprep.cc
Date: Tue, 2 May 2006 20:01:05 -0400

On  3-May-2006, David Bateman wrote:

| I think I've eliminated the quadratic behavior of mat2cell with the 
| attached version. I now get
| 
| octave:1> n = 1000;
| octave:2> s = repmat('a',1,n);p=ones(1,n);
| octave:3> tic;v=mat2cell(s,1,p);toc     
| Elapsed time is 0.021194 seconds.
| octave:4> tic;v=mat2cell(s,1,p);toc     
| Elapsed time is 0.013100 seconds.
| octave:5> n = 5000;
| octave:6> s = repmat('a',1,n);p=ones(1,n);
| octave:7> tic;v=mat2cell(s,1,p);toc     
| Elapsed time is 0.044708 seconds.
| octave:8> n = 10000;
| octave:9> s = repmat('a',1,n);p=ones(1,n);
| octave:10> tic;v=mat2cell(s,1,p);toc     
| Elapsed time is 0.088394 seconds.
| 
| which is much more respectable. Does this help your xml2mat code, or are 
| there other points that are slow?

If you agree that this version is working well enough now, then please
commit it.  Probably it should go in ov-cell.cc.  Also, to match all
the other doc strings in Octave now, the @seealso line should go just
before the @end deftypefn line.

Thanks,

jwe


reply via email to

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