Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Quote (Paren) Benchmark

From: robbo1mark::aol::com at: 13-Dec-2001 4:49

Further to my post yesterday about the usefulness of the 'quote function when used to define words to evaluating expressions (parens!) as opposed to 'does functions, I've done some simple benchmarking here with two words which do nothing. The quote paren word 'a is 100% faster in these circumstances than the word 'b does function version. Anyone care to try out some more heavy duty benchmarking to see what avarage speed gains are overall by coding without function calls? the bechmark test code is below, cheers, Mark Dickson
>> quote: func ['value] [return :value] >> a: quote ()
== ()
>> b: does [] >> b >> a >> print c: now/time loop 100000000 [a] print d: now/time prin
t [d - c "elapsed"] 9:33:46 9:34:03 0:00:17 elapsed
>> print c: now/time loop 100000000 [a] print d: now/time prin
t [d - c "elapsed"] 9:34:12 9:34:29 0:00:17 elapsed
>> print c: now/time loop 100000000 [b] print d: now/time prin
t [d - c "elapsed"] 9:34:36 9:35:10 0:00:34 elapsed
>> print c: now/time loop 100000000 [b] print d: now/time prin
t [d - c "elapsed"] 9:35:22 9:35:56 0:00:34 elapsed