When do custom tick handlers get called?

Al Hooton <[email protected]> Sat, 11 Dec 2004 19:37:47 -0800
Newsgroups gmane.comp.scigraphica.gtkextra
Message-ID <[email protected]>
	I have set up two custom tick handlers in my app, one for the left axis
and one for the bottom.  These are for ticks in a single plot on a
canvas.  The tick handler for the left axis has quite a bit of
calculation to do, in floating point, so it's somewhat compute
intensive.

	Now that the memory usage is stable, I have started working on some
optimization.  A few hours ago I ran my first gprof(1) profile, and was
shocked to find my app spending 60%+ of it's total processor demand in
the custom tick handler for my left axis!  Needless to say, I had not
expected to find my first bottleneck there...   8^)=

	I was under the assumption that when canvas_refresh() called down to a
plot to refresh itself, the plot would not spend time regenerating the
axes *unless* gtk_plot_set_ticks() had been called.  If set_ticks() has
not been called, then the axes scale/ticks have not changed, so I
figured the child plot would not rebuild/paint the axes every time it
was called.  I now see that assumption was incorrect.  Since I'm calling
canvas_refresh a few times a second (because other things are moving on
it), I'm also regenerating my axes this often, even though they never
change after I initially set them up.  This is what's eating all of my
processor cycles.

	Adrian, is there some way to get a plot to update all of it's children
*except* the axes when it's asked to refresh itself?  Or, is there
another approach that I'm missing?

	Thanks!

-Al




-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/