[Kst] Adding lots of curves through KstScript is slow

Andrew Walker arwalker at sumusltd.com
Wed Jan 27 22:58:27 CET 2010

Hi Michael,

I've added (to the 1.9.0_devel branch) the property enableRepaints on the 
Kst js-object.

So your code should now read something like:

<add the curves>

This should prevent the unncessary repaints and also trigger a repaint on 
the final call.

Let me know if you have any problems with it.


----- Original Message ----- 
From: <bug.zilla.vynce at neverbox.com>
To: <kst at kde.org>
Sent: Monday, January 25, 2010 8:10 AM
Subject: [Kst] Adding lots of curves through KstScript is slow

> 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
> _______________________________________________
> Kst mailing list
> Kst at kde.org
> https://mail.kde.org/mailman/listinfo/kst

More information about the Kst mailing list