[REBOL] Re: Series comparison techniques
From: atruter:labyrinth:au at: 14-Aug-2003 16:11
> I think you'll find that you're measuring the difference in time between
> "if equal? series/:pos value" and the internal operation of "find series
> value". Native! values are faster than mezzanine functions.
How so? EQUAL?, IF and REPEAT are all native! functions. Cutting the
search-series function down to a bare minimum, as in:
find-value2: func [series [series!] value] [
repeat pos length? series [
if series/:pos = value [insert tail rowids pos]
print now/time/precise - start
is about 10% faster (.125, 1.219 and 12.156 respectively) but still not in
the same league as find. Find seems able to iterate over a series of values
faster than a loop (which I understand) but it also seems to take less time
[per value] as more values are present (which is what I do not understand).
More is less, but how?