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

[REBOL] Re: [view] accelerating view...

From: atruter:labyrinth:au at: 16-Jan-2004 12:22

Hi Max, I use code like the following to benchmark pre and post draw FPS: <code> REBOL [] img-size: 1024x768 img: to-image layout [origin 0 box img-size blue form img-size] view/new/options center-face layout [ origin 0 i: image img img-size effect [none] ;draw [circle 100x100 100]] ; i: image img img-size effect [draw [circle 100x100 100]] ][no-title no-border] start: now/time/precise loop 100 [i/image: img show i] end: now/time/precise unview print to-integer 100 / (to-decimal end - start) </code> My rough rule of thumb is that draw will halve your optimal [View] FPS with further degredation as the draw block size increases. I use a couple of tricks to optimize refresh rates: 1. Take a snapshot of a more complex underlying face and draw on that 2. Once the draw block gets to a certain size, perform 1) again and clear the draw block 3. For "line-move" or "freehand draw" type operations, make the 'show conditional on being a certain [user specified] distance from the previous point (this allows freehand polygon drawing without "over registering" the points) 4. Ensure your s/w is run on appropriate h/w (see next) I use the following rough approximation to determine what the 1024x768 FPS of a PC should be: (GHz * Memory Speed) / 10 Sample data: P4 3G/DDR400 (3 * 400) / 10 = 120 [actual is 102] C3 1G/DDR266 (1 * 266) / 10 = 26 [actual of 4] C3 1G/DDR266 (1 * 266) / 10 = 26 [actual of 16] ; post driver update Celeron 700/33 (.7 * 33) / 10 = 2.3 [actual of 2] AthlonXP1600 / DDR266 (1.6 * 266) / 10 = 42.5 [actual of 41] FSB / Memory speed is just as important as CPU speed, so for graphics intensive tasks ensure your clients don't use a Celeron / Duron! (driver updates can also sometimes make a big difference). Regards, Ashley<