[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fast string searches
From: |
rutiger bishop |
Subject: |
fast string searches |
Date: |
Tue, 16 Jan 2007 08:42:37 -0800 (PST) |
Does anybody know of any tricks or optimized functions
for pattern matching in strings? An example of what I
am talking about is the following:
debug> tic; indx = strmatch('sensor x velocity at
aperture center (DUNITS, PCS)', value_name ); toc
Elapsed time is 0.115318 seconds.
In MATLAB, however:
K>> tic; indx = strmatch('sensor x velocity at
aperture center (DUNITS,PCS)', value_name ); toc
Elapsed time is 0.001158 seconds.
So Octave is 100 times slower than MATLAB in this
case. I can speed it up by using this instead:
debug> tic; indx = find( strcmpi('sensor x velocity at
aperture center (DUNITS, PCS)', value_name ) ); toc
Elapsed time is 0.049141 seconds.
K>> tic; indx = find( strcmpi('sensor x velocity at
aperture center (DUNITS, PCS)', value_name ) ); toc
Elapsed time is 0.000227 seconds.
MATLAB is still amazingly faster. I haven't found
anything on the Octave mailing lists yet, so I am at a
loss. This problem is causing a function that executes
in 20(sec) in MATLAB to execute in what seems like
5(min) in Octave.
____________________________________________________________________________________
Want to start your own business?
Learn how on Yahoo! Small Business.
http://smallbusiness.yahoo.com/r-index
- fast string searches,
rutiger bishop <=