[OT] RE: counter++ versus

Kevin nnoydb at excite.com
Thu Mar 25 11:09:37 EST 2004


If you ask me 'RR' is much slower than I would have expected a engine of its maturity and evolution.  Forth interpreters using direct threading and even token threading are considerably faster than 'RR'.  In fact I have written and used several interpreters (primarly Forth and Smalltalk [like]) that could in some cases out run the equvalient C++ code (primarly because the MSFT/GCC compiler failed to properly optimize).  There are also several constructs that can drastically alter performance in a TIL.  For example many TILs use a hash table for their dictionary.  In a large implementation these can cause significant speed anomalies.  In many of the engines I built the dictionary was a Red Black Tree to ensured optimal performance (more information it available on this data structure can be found int Robert Sedgewick's Algorithms book).  

Kevin

-==-=-=-=-=-=-==-=-=-=-=-=-=-=-==-=-=-=-=-=-
Disclaimer:

Any resemblance between the above views and those of my
employer, my terminal, or the view out my window are purely
coincidental. 
Any resemblance between the above and my own views is non-deterministic.

 The question of the existence of views in the absence of anyone to hold
them
is left as an exercise for the reader. The question of the existence of
the reader
 is left as an exercise for the second god coefficient. 
(A discussion of non-orthogonal, non-integral polytheism is beyond the
scope of this article.)



 --- On Thu 03/25, Brian Yennie < briany at qldlearning.com > wrote:
From: Brian Yennie [mailto: briany at qldlearning.com]
To: use-revolution at lists.runrev.com
Date: Thu, 25 Mar 2004 01:09:31 -0500
Subject: Re: [OT] RE: counter++ versus "add 1 to counter"

> was something like:<br>><br>> put 1 into c<br>> repeat for 100000000<br>>   add 2 to c<br>> end repeat<br>><br>> I don't have the c++ source<br><br>Very cool- a big applause for Rev. My C++ instincts would tell me, just <br>like your friend, that running that tight of a mathematical loop in an <br>interpreted language might be much more than 7 times slower.<br><br>But not in Rev =)!<br><br>FWIW, the equivalent C++ would be something like:<br><br>int c = 1;<br>for(int i=0; i<100000000;i++) i += 2;<br><br>Of course, the compiler might make a big difference- some compilers may <br>be smart enough to effectively optimize that loop to become the same as:<br><br>int c = 1;<br>i += 200000000;<br><br>Speaking of which, has anyone ever considered writing an optimizer for <br>Transcript, that does basic stuff like unrolling loops, killing dead <br>branches, etc? It would probably even be possible to pre-process <br>scripts to make sure they use "repeat for each" when necessary, and <br>other much-discussed optimizations.<br><br>- Brian<br><br>_______________________________________________<br>use-revolution mailing list<br>use-revolution at lists.runrev.com<br>http://lists.runrev.com/mailman/listinfo/use-revolution<br>

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!


More information about the use-livecode mailing list