>Hi to all who are interested in this topic.
>
>We have had an interesting discussion, including some research, under the topic 'VFP versus C++'. This new topic is kind of a continuation, but it has a slightly different focus. Al Doman postulates the hypothesis that the newer functions are faster than the older functions. See also his post:
Re: VFP versus C++ Thread #
842594 Message #
843390.
>
>Several thoughts come to my mind:
>- Is 32-bit versus 16-bit indeed a factor?
>- Functions are unique, that is, no two functions do exactly the same thing. So, how can they be
> compared with respect to speed?
>- What is the hierarchy of the functions with regard to speed?
>- Can we say that the newest functions compete well with the C++ equivalents?
Peter,
I, for one, do not believe that older functions are slower. 16/32 bit is not an issue since they are recompiled each time we get a new release of foxpro.
The problem you had was the repeated use of at() as in
for i = 1 to n
p = at('Something', SomeString, i)
endfor
Each time At() is called, it has to rescan the string skipping all previous (i-1) occurrences
So, if the max is n, you will have scanned for 'Something' (n * (n+1) / 2) times.
If n is 10000 : roughly: 10000^2/2 = 50,000,000
Hence the difference in speed. The RegExp and alines() only match an occurrence
oncemy 2 EUR cents
Gregory