public inbox for guile-gtk@sourceware.org
 help / color / mirror / Atom feed
* Big memory problem with the canvas and gnome-guile
@ 2000-12-11 11:50 Ariel Rios
  0 siblings, 0 replies; only message in thread
From: Ariel Rios @ 2000-12-11 11:50 UTC (permalink / raw)
  To: guile-gtk, federico; +Cc: guile

Recently for a school project I wrote a simple L-System generator
that comes with a logo-like implementation that enables to do
a graphical interpretation of the strings generated by the L-System
Look on:
http://www.cogs.susx.ac.uk/users/gabro/lsys/lsys.html
for more info on L-Systems

We need to take an L-System like:
 w: F+F+F+F 
  p: F -> F+F-F-FF+F+F-F
 and then according to the number of substitutions we do we get a final
string. Each F is interpreted as draw a line and the + - signs indicate
a change on the angle.

for drawing each line I do:
(gnome-canvas-item-new  (root-component obj) 'GnomeCanvasLine 
          :points (vector xo yo xf yf))

The problem is that when I do select an iteration number >= 5,
the pogram is damn slow and starts using memory in a huge way.

My thought is that creating a big number of canvas items is taking
that bunch of memory. HOwever I don't know if its a guile, guile-gtk
or GNOME canvas memory problem. Can you help to track me down this
problem?

Obviously I can change the hack and instead of drawing a line per each
F found on the string I can create a global vector to create at the end
only one canvas item. Still I would like to track the memory problem.

You can find the code at:
http://www.netpedia.net/hosting/erin/download/lsys.tar.gz

It includes the code and a small document about L=Sys.
To run it you need to do:
guile-gtk -l lsys-main.scm

You need to have a working gnome-guile, guile 1.4
and goops 0.9.0.

Thanks!

ariel 


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2000-12-11 11:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-12-11 11:50 Big memory problem with the canvas and gnome-guile Ariel Rios

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).