[REBOL] Graph Drawing & /View Performance
From: chris:langreiter at: 6-May-2002 20:22
I've spent most of today with porting the algorithm behind the
fantastic TouchGraph applet (http://www.touchgraph.com) to
REBOL/View. Originally I intended only to output the node coordinates
after, say, 1000 iterations to handle final display to Flash or
whatever.
http://www.langreiter.com/rebol/txrx/txrx-1.r
Just to make sure everything was okay I visualized the result with
REBOL/View, and - shock! - was just amazed at how fast it was (I've
also ported the algorithm to Flash/ActionScript - it's pretty much
impossible to increase the number of nodes to over 15 or even 20 -
REBOL/View seems to be a whole lot faster).
But then, when I tried to figure out a way to implement edge drawing,
all my /Viewnduced happiness came tumbling down. I can't seem to
figure out a way to _quickly_ (REALLY quickly) draw lines in
/View. My first naive attempts involved the effect facet and the Draw
Dialect, but performance was just - horrendous.
The best thing I can come up with is creating and setting images as
often as needed, but there _must_ be a better (i.e. faster) way ...
Some way that allows me to directly act upon an existing image.
f/image/clear
f/image/line 200x200 150x300
Comment the line "f/image: to-image edge-layout" to see how fast node
layouting is with edge drawing turned off.
I hope one of the Masters of /View can guide me through this
semi-documented dark cave of poor performance.
Otherwise, enjoy ;-)
-- Chris
-- http://www.langreiter.com