Yes that is a useful performance comparison.

Timings on my 32-bit Win7 system:
J6.02       wd : less than a second
J7.01beta  gtk : less than 2 seconds
J7.01beta cairo: ~ 10 seconds

Would it be worth trying out drawing the image using native graphics libraries 
(media/platimg) and then copying the resulting bitmap buffer to gdk for display?

Ric

> From: bill lam
> Sent: Wednesday, 30 June 2010 15:22
> 
> Plot using gdk is faster than cairo but still slower than j602.
> 
> require'gui/gtk'
> coinsert 'jgtk'
> 
> L0=: 50           NB. initial length
> A0=: 1r8p1        NB. initial angle: pi divided by 8
> dL=: 0.9          NB. shrink factor for length
> dA=: 0.75         NB. shrink factor for angle
> N=: 14            NB. number of branches
> 
> L=: L0*dL^1+i.N  NB. lengths of line segments
> 
> NB. relative angles of successive line segments
> A=: A0*(dA^i.N) +/\@:*("1) _1 ^ #:i.2 ^ N
> 
> NB. end points for each line segment
> P=: 0 0+/\@,"2 +.*.inv (L0,0),"2 L,"0"1 A
> 
> NB. =========================================================
> gtk_show=: 3 : 0
> gtkinit ''
> newwindow 'graph'
> locGB=: 540 400 conew 'jgtkgraph'
> coinsert__locGB coname''
> gtk_container_add window,gtkbox__locGB
> windowfinish''
> if. -.IFGTK do. gtk_main '' end.
> )
> 
> NB. =========================================================
> NB. this is the main drawing program
> paint=: 3 : 0
> NB. 'Cw Ch'=: glqwh''
> gllines <.(10 + ,/"2 P-"1<./,/P)
> 0
> )
> 
> window_delete=: 0:
> 
> gtk_show ''
> 
> --
> regards,
> ====================================================
> GPG key 1024D/4434BAB3 2008-08-24
> gpg --keyserver subkeys.pgp.net --recv-keys 4434BAB3
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to