Merge lp:~kolmis/cairoplot/speedup into lp:cairoplot
Proposed by
Karel Kolman
Status: | Merged |
---|---|
Merged at revision: | 41 |
Proposed branch: | lp:~kolmis/cairoplot/speedup |
Merge into: | lp:cairoplot |
Diff against target: |
161 lines 4 files modified
trunk/cairoplot.py (+15/-6) trunk/seriestests.py (+21/-7) trunk/testscripts/compare.sh (+22/-0) trunk/testscripts/timeit.sh (+3/-0) |
To merge this branch: | bzr merge lp:~kolmis/cairoplot/speedup |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Rodrigo Moreira Araújo | Pending | ||
Review via email: mp+12980@code.launchpad.net |
To post a comment you must log in.
Hi, i'm experimenting with using cairoplot to render plots in the wxbanker project and i stumbled upon some performance related problems which lead me to examining cairoplot's code. Summary of changes proposed in this branch:
- speed up x_labels rendering
+++ (create the rotation matrix once only, apply it for each x_label - this is a major improvement)
- added a timer.sh script and a test plot with 1000 x_labels to show the performance difference
- replace rotate(angle), rotate(-angle) pairs with save(), rotate(angle), restore() triples
+++ (i have absolutely none experience in graphics programming, but i think this is the way to go, since i'd say these two rotations added don't have to result in an identity matrix due to floating number arithmetics and rounding errors)
- added a script for visual comparison of outputs, it diffs two outputs from seriestests.py and creates diff images in PPM format
+++ i performed the following test: i created two cairoplot versions:
====== 1. all show_text() references removed, the rotate(angle), rotate(-angle) statements stayed
====== 2. all show_text() references removed, all rotate() pairs removed
====== comparing these two some plots were different whereas they should be exactly the same