RunRev vs RealBasic (Richard Gaskin)

David Grogono dave at realsoftware.com
Thu Jan 20 17:03:50 EST 2005


Richard Gaskin wrote:

> We had a rather funny thread here last year in which an RB fan started a
> bake-off for speed on a parsing algorithm on a fairly large file.  True
> 'nuff, RB was faster -- but only by 3 milliseconds. And that was the
> overal score -- in the most common task, loading a file, Rev was nearly
> twice as fast.

A number of small clarifications on this.  The person who started the speed
comparison was not an "RB fan" but rather a SuperCard user evaluating both
REALbasic and Revolution.  His initial attempt found that REALbasic was
significantly faster than Revolution.  After both sets of code were further
optimized the speed differences were negligible.  The primary difference
after optimization is the readability and maintainability of the code.  The
guts of the routine in REALbasic is 6 lines of code but 37 lines of code in
Revolution.  As for the speed of the load, the results are probably
misleading for REALbasic because it includes the first step of string
processing.  Either way the load is extremely fast in both environments and
it's a tiny tiny fraction of the total task.  Here's the code for each
environment:  copied from <http://www.yav.com/speed.html>

REALbasic:
 x=uBound(STarray)
 For i = 0 to x
   If InStrB(TT,(STarray(i))) > 0 then
     Matches=Matches+STarray(i)+chr(13)
   End if
 Next

Revolution:
 replace quote with empty in stList
 put lower(tMatchList) into tLowerMatchList
 replace quote with empty in tLowerMatchList

 put md5Digest(tMatchList) into tDigest
 if (tDigest <> textDigest) then
 put empty into shortFindList
 repeat for each word w in tLowerMatchList
 put char 1 of w into c
 put c after shortFindList
 put TRUE into isWord[w]
 put TRUE into isWord[w0&w]
 put w into w0
 end repeat
 put tDigest into textDigest
 end if

 set the caseSensitive to TRUE

 repeat for each line inLine in stList
 put empty into shortFind
 put lower(inLine) into inLineLower
 put 0 into i
 put empty into w0
 repeat for each word w in inLineLower
 if not isWord[w0&w] then
 put empty into shortFind
 exit repeat
 end if
 put char 1 of w after shortFind
 put w into w0
 end repeat
 if (shortFind is empty) then next repeat
 put offset(shortFind, shortFindList) into x
 if (x > 0) then
 if (offset(inLineLower, tLowerMatchList, x*2-1) > 0) then
 put inLine & return after MatchList
 end if
 end if
 end repeat

--
David Grogono



More information about the use-livecode mailing list