On 1/4/2000 at 5:37 PM [EMAIL PROTECTED] wrote:

"since all you have to do is compare two pointers to memory and two
indexes."

Most of us don't have access to the implementation details, so it's
hard to say what REBOL has to do. All we can see is what it does.

Cool experiment, though.

Do you get any different results using functions rather than operators?

Do you get different results with larger and smaller loops? Larger and
small strings?

Do you get different results with operations other than comparison?

Do you get different results with greater or fewer words defined?

What's the source of time-it?

-Ted.

*********** REPLY SEPARATOR  ***********

On 1/4/2000 at 5:37 PM [EMAIL PROTECTED] wrote:

Hi there,

One thing I find very puzzling on this subject:

>> c: copy b: a: head insert/dup "" "a" 100000 print "done"
done
>> time-it [loop 5000 [a = b]]     ; 1) should be done very fast
0:00:15
>> time-it [loop 5000 [a = c]]     ; 2) takes time, of course
0:00:19
>> time-it [loop 5000 [a =? b]]    ; 3) should be done very fast
0:00:15
>> time-it [loop 5000 [a =? c]]    ; 4) should be done very fast
0:00:18

=? is the operator for SAME?

2) takes time because 100,000 characters have to be compared. But it
should
take almost no time at all to determine if two string values are the
"same",
as in 3) and 4), since all you have to do is compare two pointers to
memory
and two indexes. Likewise, if two values are the "same", they must be
equal,
so ideally 1) should be fast as well. So why doesn't REBOL do this a
little
more efficiently?

See you,
Eric



Reply via email to