Group creation needs optimisation (to run faster)

Bug #616150 reported by Louis Simard
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scour
Fix Released
Medium
Unassigned

Bug Description

Bug 490197 is a wishlist bug requesting progress information for large files. The example SVG file, re-attached here, is 2.2 MB and takes 53 minutes of Python time to optimise.

I am a fan of trying to find the root cause of problems in most cases, not masking them. So I'm reporting this bug to first try to get Scour faster than it is right now, before adding progress information.

Initial notes: There are 18426 polygons in that file, and each of them has 3 points. This means that, if the polygons take up most of the optimisation time, each took 0.17 second (442 million CPU cycles) to process. That's a long time for a 3-point polygon!

-- versions --
Scour 0.25
Python 2.6.5
Psyco not installed

-- specs --
2.6 GHz AMD processor
DDR2 800 MHz
32-bit Linux

-- command-line and output --
$ time ./scour.py --create-groups --enable-id-stripping --enable-comment-stripping --shorten-ids --remove-metadata -i example.svg -o example.opt.svg
[...]
real 55m54.557s
user 53m19.344s
sys 0m19.781s

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :
summary: - Polygon optimisation needs optimisation (to run faster)
+ Group creation needs optimisation (to run faster)
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Bad analysis on my part. I've determined with a fair bit of debug information that it's really the --create-groups option giving slowdowns. I'll debug this further and attach a patch.

Changed in scour:
assignee: nobody → Louis Simard (louis-simard)
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

After this patch:

real 0m41.718s
user 0m31.154s
sys 0m8.921s

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

Applied to the trunk, in revisions 190 and 192. All unit tests pass.

Changed in scour:
status: In Progress → Fix Committed
Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

This bug is fixed in release 0.26 of Scour.

Changed in scour:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.