From: William P. Y. H. <wil...@gm...> - 2006-02-21 13:01:21
|
On 2/21/06, Dmitri A. Sergatskov <das...@gm...> wrote: > > > > The implementations are attached as text attachments. I personally > > prefer implementation 1, but for inclusion to octave I think John > > should choose one. > > Reading my own words, it's like "John should choose 1". What I mean is, I think John should choose one of the above. > > FWIW: In my experience I need to use strfind usually on text that is > a string. Normally this is a part of parsing of some external data file > with a not well-defined structure. > The text is a cellstr usually when there is a known or well-defined > structure and one can use this knowledge to optimise the search. > So my vote would go for the Implementation 4 -- I would like to have > the best performance for the most common case rather than the best > performance in the most general case. > Well, Implementation 1 has the best performance in both cases I tested above... Although I must admit that the code for the pattern search (5 lines) is duplicated (once for string, once for cellstr). -- William Poetra Yoga Hadisoeseno |