"Combine" underperforms on very large selections

Bug #1717877 reported by Michał Tyszkiewicz
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
New
Undecided
Unassigned

Bug Description

Inkscape version 0.91
OS: Xubuntu 16.04.3 LTS

In short: when working with SVGs with huge amounts (tens of thousands) of lines, that are grouped into several groups of ~5k components, using combine on all of them is so slow that it never ends, and seemingly ramps memory usage ad infinitum in the process. If I however combine each group separately, and then combine them all together, this process can be completed below a minute in total, albeit involves a lot of unnecessary clicking.

Details: I'm marking my bicycle routes on google maps, exporting those to .kml and then converting to .svg via http://www.gpsvisualizer.com/ . This process leaves me with an SVG that contains over 100k <line> markers (compressed version attached), because of inefficient implementation of said tools. The markers are grouped into big groups, which correspond roughly to each day of cycling. I now want to combine <line>s in each layer into a single path, in order to compress the file and speed up further processing. If I hit ctrl+A, ctrl+K the process will never end, exhausting my RAM after several minutes. If I however mark each group and hit ctrl+K, and then mark all the groups and hit ctrl+K again, the process will finish reasonably quickly.

Proposal: As far as I understand what combine is supposed to do, it is an associative operation (at least in terms of visual effect), so I suggest that the combine operation, by default, should work in such a divide and conquer mode. This would also enable running the combination in parallel, while currently it only uses a single processor.

I am interested in looking into fixing this issue myself, but I would need a bit of tutoring (to help locate where the relevant pieces of code sit in the repo).

Tags: performance
Revision history for this message
Michał Tyszkiewicz (jatentaki) wrote :
Revision history for this message
Mc (mc...) wrote :

>I am interested in looking into fixing this issue myself, but I would need a bit of tutoring (to help locate where the relevant pieces of code sit in the repo).

To locate the relevant path in the code of any action, start in verbs.cpp (ctrl+f combine → "selection->combine(); line 1281)
This is a method of the selections, and selections are objectSets (selection.h:60), so you'll have to look at object-set.h, which has an helpful comment at line 400 telling in which cpp file it's implemented.

→ it's in src/path-chemistry.cpp , lines 54-192

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.