[Kst] [Bug 108026] Fix performance problem in axis labels

George Staikos staikos at kde.org
Fri Jun 24 04:18:46 CEST 2005


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=108026         




------- Additional Comments From staikos kde org  2005-06-24 04:18 -------
There is debug output in Kst to illustrate the problem.  See below.  We keep 
reusing the same label which causes many problems (and is verifiably slow).

1) we do 2 draws into a pixmap
2) we constantly reparse
3) the old label parser is slow (and incorrect)

kst: >>>>>>>>>>>>>>>>>>>> DRAWING PLOT P3
kst: label: old text was [] new text is [1]
kst: Did draw in width()
kst: label: old text was [1] new text is [10]
kst: Did draw in width()
kst: label: old text was [10] new text is [100]
kst: Did draw in width()
kst: label: old text was [100] new text is [1000]
kst: Did draw in width()
kst: label: old text was [1000] new text is [10^{4}]
kst: Did draw in width()
kst: label: old text was [10^{4}] new text is [10^{5}]
kst: Did draw in width()
kst: label: old text was [] new text is [0.001]
kst: Did draw in width()
kst: label: old text was [0.001] new text is [0.01]
kst: Did draw in width()
kst: label: old text was [0.01] new text is [0.1]
kst: Did draw in width()
kst: P3: x_px = 955 xright_bdr_px = 31 xleft_bdr_px = 77 y_px = 198 
ybot_bdr_px = 44 ytop_bdr_px = 30
kst: Did draw in width()
kst: Did draw in width()
kst: Did draw in width()
kst:         Lines clocks: 150000
kst: Plotting curve 0: 179ms
kst:     Without locks: 179ms
kst:             Lines: 179ms
kst:         Lines clocks: 140000
kst: Plotting curve 1: 189ms
kst:     Without locks: 189ms
kst:             Lines: 189ms
kst: Plot Benchmark stats:
kst:    Initialization: 12ms
kst:    Plot Labels: 4ms
kst:    Plot Images: 0ms
kst:    Plot Grid Lines: 0ms
kst:    plot Legend: 0ms
kst:    Plot Curves: 368ms
kst:    plot Axes: 1ms
kst:    plot Markers: 0ms
kst:    plot arbitrary Labels: 0ms
kst:    Flush Painter: 122ms
kst: Plot Total: 507ms
kst:    -> object P3 took 508ms
kst:  -> Parent class took 943ms

Note that these stats are very skewed, but the label plotting is in fact very 
expensive in some cases.  quietriot.js illustrates the problem quite nicely.

There is a new KstPlotLabel class which is just a tool (probably incomplete) 
for Kst2DPlot to draw labels with the new renderer.  Tests show that the new 
one is very fast and allows us to bypass much of the overhead associated with 
KstLabel.


More information about the Kst mailing list