Thousands of Graphics = Bad Performance

Scott Rossi scott at tactilemedia.com
Mon Feb 7 14:42:54 EST 2005


Recently, Thomas Gutzmann  wrote:

> some time ago I discussed with some of you ways to display very "heavy"
> graphics in Rev at an
> acceptable speed.
> 
> Well - I failed. I think if I want to do it with Rev, I have to write some
> sort of plugin.
> 
> I tried:
> 
> - set the properties of the templateGraphic, so only the positions and lengths
> of the graphics had
> to be changed before actually drawing them
> - lock messages and screen, of course
> - draw 2000 objects
> -> this alone took up to 14 seconds (PB 17" 1 GHz 2 GB), though I tried to
> save cycles
> 
> - then scrolling these objects takes 3 seconds :-(

One thing to remember about doing this kind of thing in Rev is that the
default behavior of the development environment is to track all objects.  If
you allow the IDE to track all 2000 items, it will indeed slow down and take
a good deal of time to manage them.

However, if you 1) lock messages and 2) lock the screen before creating
thousands of objects, you should be able to create them very quickly,
especially with vector (graphic) objects.  If you remember to group the
resulting set of grcs, the you have the added bonus of being able to delete
a single group, rather than deleting each grc one by one.

I just tried a simple test of creating 2000 random rect graphics on a 600 x
500 card, and was able to create and group the graphics in less than 2
seconds (a 466 mHz machine).  After increasing the graphic count to 5000,
the total time was about 6-1/2 seconds.  So Rev can actually be very fast
depending on what you are doing.

Because Rev often provides multiple ways of doing a single task, achieving
desired results is often a matter of testing several methods.

Regards,

Scott Rossi
Creative Director
Tactile Media, Multimedia & Design
-----
E: scott at tactilemedia.com
W: http://www.tactilemedia.com



More information about the Use-livecode mailing list