Performance issues with "Snap to path intersections"

Bug #1087470 reported by ScislaC
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
High
Diederik van Lierop

Bug Description

When "Snap to path intersections" is enabled, performance can take a huge hit. To make it worse, even if snapping is disabled on a global level, it still affects performance if that option was enabled.

Tested with 0.48.3.1 and trunk r11935 on Ubuntu 12.10. Try to move the objects with the mouse in the attached file. Simply turning off the "Snap to path intersections" option will make it perform as expected.

If this gets fixed and a backport is possible, we should do it.

Revision history for this message
ScislaC (scislac) wrote :
Revision history for this message
su_v (suv-lp) wrote :

Reproduced with Inkscape 0.47, 0.48.x and current trunk (r11936) on OS X 10.7.4.

Importance 'High' -> if global snapping is turned off, no snapping should occur at all.

tags: added: snapping
tags: added: performance
Changed in inkscape:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

This has been improved in rev. #11937. It is line 1199 in sh-shape.cpp

  cs = self_crossings(*path_it)

which is the culprit. It was even called twice! I fixed that, and also made sure that it is no longer being called when not needed (determined by the status of the snap toolbar).

So it can still be slow for complex paths, but at least the delay for the selection to start moving has halved. It should start moving at some point though, just try to be patient ;-)

Please feel free to apply these changes to the v0.48.4 branch, should you have a checkout of that branch lying around somewhere....

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
ScislaC (scislac) wrote :

it's an improvement, working on backport

Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote : Re: [Bug 1087470] Re: Performance issues with "Snap to path intersections"

Thanks!

The things we could do to improve this even further are:
1) speed-up the 2geom routines
2) calculate the intersections pre-emptively, while inkscape is idle,
and cache them
3) calculate the intersections while dragging (not before), in a
seperate thread

Each of them is a whole different ball-game unfortunately

Revision history for this message
ScislaC (scislac) wrote :

not all could be backported as a lot of changes have been made since 0.48, however, the most crucial bits did backport so it performs the same as trunk. (backported in r9934 of 0.48.x branch)

Changed in inkscape:
milestone: none → 0.48.4
Revision history for this message
Diederik van Lierop (mail-diedenrezi) wrote :

Sorry, didn't see that coming! If I had known than I would have taken
care off this myself.

Thanks for your help though!

Ted Gould (ted)
Changed in inkscape:
status: Fix Committed → Fix Released
Revision history for this message
su_v (suv-lp) wrote :

@Diederik - if time permits, could you please take a look at bug #1093739, and close that report if this change in 0.48.4 wrt the default snap behavior is essential to address the performance issue reported here (bug #1087470)?

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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