In the discussion about handling "untrusted" data, I noticed that 
Gabriele used "to block!" whilst Sunanda used to "to-block". I'm trying 
to understand if this is just a matter of personal preference or there 
is a real difference.

On my machine, to block! appears to be at least 15 percent quicker than 
to-block as shown by the following timing test. The test isn't very 
accurate because I had other applications loaded on the machine at the 
time. I did run a loop of 25 timing tests and to block! was always 
quicker.

Regards

Peter

 >> speedy: [
[    time-to-block: make time! 0
[    time-to: make time! 0
[
[    loop 100 [
[        start: now/time/precise
[        loop 1000 [ to-block "12345" ]
[        end: now/time/precise
[        time-to-block: time-to-block + end - start
[
[        start: now/time/precise
[        loop 1000 [ to block! "12345" ]
[        end: now/time/precise
[        time-to: time-to + end - start
[        ] ; end loop 100
[    print [ "average time for to-block" (time-to-block / 100) ]
[    print [ "average time for to block!" (time-to / 100) ]
[    ]
== [
     time-to-block: make time! 0
     time-to: make time! 0
     loop 100 [
         start: now/time/precise
         loop 1000 ...
 >> do speedy
average time for to-block 0:00:00.0067641
average time for to block! 0:00:00.00569063
 >> do speedy
average time for to-block 0:00:00.00674169
average time for to block! 0:00:00.00503805
 >> do speedy
average time for to-block 0:00:00.00682156
average time for to block! 0:00:00.00574013

-- 
To unsubscribe from the list, just send an email to rebol-request
at rebol.com with unsubscribe as the subject.

Reply via email to