Hi All,
wxPyPlot V1.3 Beta 1 is now available at
http://www.cyberus.ca/~g_will/wxPython/wxpyplot.html
Changes from 1.2
- font cache for Linux speed problems
- scaleAndShift only done when required
- deprecation warning removed during zoom.
A couple of people on this list have been working on multiple bitmaps for
the background (grid, labels, legend) and foreground plotting in wxPyPlot
because they felt that replotting the background for each time was slowing
things down. I could not understand this because I felt that background
drawing was only a small percentage of the time for large numbers of data
and this was not really an issue.
But I think the light just came on thanks to Eric Blossom!! Differences
between Windows and Linux again! I recently got a message from Eric with a
patch for font caching. He writes:
Hi,
Here's a patch for wxPyPlot-1.2-final that dramatically speeds it up
under linux. Haven't tested it under windows.
FWIW, we're using wxPyPlot to plot real time data with a refresh rate
of 25 Hz. Without this patch, the X font server ends up sucking up
about 70% of the CPU on a 1.7 GHz pentium. With the patch applied,
the font server is out of the loop.
Thanks for making wxPyPlot available.
Eric
···
--------
After some profile testing on *windows*, I confirmed that drawing the
background takes 8-10 % of the time. The rest of the 90%+ time is taken
drawing points and lines (25,000 squares, 25,000 lines). On my 1GHz Athlon
this takes roughly .3 sec.
I've added that patch, and found that it doesn't change the performance on
Windows, but would like users to test it out under Linux to see if there is
any speed improvement.
I have used OnPlotDraw4 for profiling and get the following results for 10
calls to draw (cumulative times on right) using the profile and pstats
modules:
wxPyPlot.py:651(Draw) fonts.py:128(__del__)(30) 0.002
gdi.py:566(BeginDrawing)(10) 0.000
gdi.py:572(Clear)(10) 0.001
gdi.py:578(DestroyClippingRegion)(10)
0.001
gdi.py:648(EndDrawing)(10) 0.000
gdi.py:713(GetTextExtent)(30) 0.006
gdi.py:780(SetFont)(30) 0.002
gdi.py:1004(__init__)(10) 0.001
gdi.py:1062(__init__)(10) 0.001
wxPyPlot.py:279(boundingBox)(10) 0.121
wxPyPlot.py:287(scaleAndShift)(10) 0.366
* wxPyPlot.py:291(setPrinterScale)(10)
0.000
wxPyPlot.py:307(getXLabel)(10) 0.000
wxPyPlot.py:311(getYLabel)(10) 0.000
wxPyPlot.py:315(getTitle)(10) 0.000
* wxPyPlot.py:319(draw)(10) 2.485
wxPyPlot.py:877(_drawLegend)(10) 0.026
wxPyPlot.py:903(_titleLablesWH)(10)
0.009
wxPyPlot.py:915(_legendWH)(10) 0.010
wxPyPlot.py:950(_getFont)(30) 0.018
wxPyPlot.py:965(_point2ClientCoord)(10)
0.002
wxPyPlot.py:979(_axisInterval)(20) 0.001
wxPyPlot.py:1010(_drawAxes)(10) 0.072
wxPyPlot.py:1054(_ticks)(20) 0.007
wxPyPlot.py:1168(__init__)(10) 0.000
wxPyPlot.py:1172(DrawText)(20) 0.013
wxPyPlot.py:1176(SetClippingRegion)(10)
0.001
wxPyPlot.py:1180(__getattr__)(100) 0.004
The point and line drawing is done mostly by wxPyPlot.py:319 and
wxPyPlot.py:287(scaleAndShift). The rest is background stuff.
I hope this solves the speed problems on Linux. If I have misunderstood the
problem, please let me know.
Regards,
Gordon Williams