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

[REBOL] Re: Graph Drawing & /View Performance

From: rotenca:telvia:it at: 8-May-2002 2:33

Hi, Christian
> Actually I have tried this solution, with the somehwat startling > effect that it was probably the slowest variant of 'em all. the > (cumbersome IMO) to-image method is way way faster.
It seems very strange to me because you draw lines on a face before calling to-image, so to-image is time consuming. On the console (the code is messy) i have written this example which simulate your program: n: 0 x: make block! 3000 create: does [ n: n + 1 if n = 100 [unview] foreach x l/pane [ if x/size = 60x22 [ x/offset: random 500x500 ] ] clear x loop 500 [ insert x reduce ['line random 250x250 250x250 + random 250x250] ] x ] l: layout [ im: image 500x500 rate 0 white effect [] feel [ engage: func [f a e] [ f/effect: compose/deep [ draw [(create)] ] show l ] ] ] for i 1 150 1 [ append l/pane make-face/size/spec 'box 60x22 [ color: random 255.255.255 offset: random 500x500] ] view/new l t1: now/precise do-events t2: now/precise print [t2/time - t1/time n] and on a system with Celeron 333 Mhz and an old graphic card i have about 17 sec for moving 150 faces and drawing 500 lines 100 times --- Ciao Romano