[Kst] Adding lots of curves through KstScript is slow

bug.zilla.vynce at neverbox.com bug.zilla.vynce at neverbox.com
Mon Jan 25 17:10:38 CET 2010


I'm running Kst 1.8.0 on Fedora 10.

I sometimes deal with data files with 200+ fields and 70,000+ samples
per field. I setup all of the plots through KstScript and everything
goes pretty quickly until I start appending curves to the plot's
CurveCollection. The first few curves get added quickly, but adding
each additional curve takes exponentially longer -- like 30 minutes
for a data file with 300 fields. Most of the curves get added to one
plot.

Looking at the code in kst2dplot.cpp, it appears that the whole plot
and all of its curves get completely repainted every time a new curve
is added. If this is the case, one solution would be to make it
possible to add an array of curves to a plot at once. That way, all of
the painting and range calculations only need to be done once.

A more hacky workaround would be to add a KstScript function to
suspend and resume painting. Painting could be suspended before adding
curves and then resumed again afterwards.

Another alternative would be to schedule a repaint a second or two in
the future when a curve is added. The repaint would get rescheduled
every time a curve is added. So as long as you're adding curves
rapidly, the painting gets delayed.

I know you're all very busy with Kst2, but hopefully someone can help
me with this.

Thanks,
Michael



More information about the Kst mailing list