Capabilities: RTF editing, Graphs, flat-file database

Richard Gaskin ambassador at fourthworld.com
Fri Jun 11 09:30:32 EDT 2004


Mark Smith wrote:
 > On 11 Jun 2004, at 05:43, use-revolution-request at lists.runrev.com wrote:
 >
 >> It's been a while since I've benchmarked it, but if I recall
 >> correctly I
 >> believe accessing a custom property is nearly as fast as a global,
 >> and like globals are several orders of magnitude faster than field
 >> accesses.
 >>
 >> Anyone care to run a set of benchmarks on the current engine to see
 >> how that holds up today?

 > I don't  know if this is a decent test, but this is what I got:
 >
 > fld 1 contains 1000000 lines, each line consisting simply of "1".
 >
 > --fld access
 > on mouseUp
 >   set cursor to watch
 >   put the ticks into stTime
 >     repeat for each line L in fld 1
 >       put L into p
 >     end repeat
 >   put the ticks - stTime
 > end mouseUp
 >
 > result - 77 ticks
 >
 > --custom prop access
 > on mouseUp
 >   set cursor to watch
 >   set the pData of this cd to fld 1
 >   put the ticks into stTime
 >     repeat for each line L in the pData of this cd
 >       put L into p
 >     end repeat
 >   put the ticks - stTime
 > end mouseUp
 >
 > result - 45 ticks
 >
 > --var access
 > on mouseUp
 >   set cursor to watch
 >   put fld 1 into vData
 >   put the ticks into stTime
 >     repeat for each line L in vData
 >       put L into p
 >     end repeat
 >   put the ticks - stTime
 > end mouseUp
 >
 > result - 45 ticks
 >
 >
 > Doesn't really look like orders of magnitude difference...is
 > the test OK?

All three are using a variable in the loop, with the only change being 
where the variable was loaded from.

If the loop itself is performed on the data where it's stored you should 
see a significant difference.

-- 
  Richard Gaskin
  Fourth World Media Corporation
  ___________________________________________________
  Rev tools and more:  http://www.fourthworld.com/rev



More information about the use-livecode mailing list