Bug 19312 - SVG hit testing is *way* too slow
: SVG hit testing is *way* too slow
Status: RESOLVED FIXED
: WebKit
SVG
: 528+ (Nightly build)
: Macintosh Mac OS X 10.5
: P2 Normal
Assigned To:
:
:
:
:
  Show dependency treegraph
 
Reported: 2008-05-29 10:57 PST by
Modified: 2010-05-05 00:31 PST (History)


Attachments
test case (sorta a layout test, not quite) (2.54 KB, image/svg+xml)
2008-05-29 10:58 PST, Eric Seidel
no flags Details
Patch (1.57 KB, patch)
2008-12-30 22:32 PST, Simon Fraser (smfr)
no flags Review Patch | Details | Formatted Diff | Diff
Patch (1.59 KB, patch)
2010-05-04 12:49 PST, Dirk Schulze
no flags Review Patch | Details | Formatted Diff | Diff


Note

You need to log in before you can comment on or make changes to this bug.


Description From 2008-05-29 10:57:43 PST
SVG hit testing is *way* too slow

See the attached test case.

I think the major problem is that RenderPath::nodeAtPoint() does not to any sort of optimization (like checking against the bbox) before testing against fill contains.  Thus for an example like the one in the test case, we end up doing hundreds if not thousands of unnecessary path containment tests (which may involve mallocs, etc).
------- Comment #1 From 2008-05-29 10:58:59 PST -------
Created an attachment (id=21416) [details]
test case (sorta a layout test, not quite)

See the attached test case.  We don't really have a very good way to do perf-based layout tests.  The attached test could be modified to be say PASS when it runs under a certain threshold or something.
------- Comment #2 From 2008-12-30 22:32:27 PST -------
Created an attachment (id=26329) [details]
Patch

This patch implements your suggestion, and removes much of the hit testing cost. However, repaint is still very expensive. Sharking found bug 23050.
------- Comment #3 From 2008-12-30 22:44:47 PST -------
Repaint is very expensive because EVERYTHING repaints even if only a small area is dirtied.RenderPath::paint() does no short-circuiting if the relativeBBox() is not in the dirty rect.
------- Comment #4 From 2009-01-02 15:30:08 PST -------
See also bug 15393.
------- Comment #5 From 2009-12-30 13:36:02 PST -------
*** Bug 15704 has been marked as a duplicate of this bug. ***
------- Comment #6 From 2009-12-30 13:44:11 PST -------
(In reply to comment #3)
> Repaint is very expensive because EVERYTHING repaints even if only a small area
> is dirtied.RenderPath::paint() does no short-circuiting if the relativeBBox()
> is not in the dirty rect.

Will the patch on bug 30055 fix this?
------- Comment #7 From 2010-05-04 12:49:40 PST -------
Created an attachment (id=55039) [details]
Patch
------- Comment #8 From 2010-05-04 12:50:58 PST -------
(In reply to comment #7)
> Created an attachment (id=55039) [details] [details]
> Patch

This is a huge speed-up of the test attached to this br.
------- Comment #9 From 2010-05-04 13:06:48 PST -------
(From update of attachment 55039 [details])
Looks great to me, as discussed before :-) r=me.
------- Comment #10 From 2010-05-05 00:31:46 PST -------
(From update of attachment 55039 [details])
Clearing flags on attachment: 55039

Committed r58804: <http://trac.webkit.org/changeset/58804>
------- Comment #11 From 2010-05-05 00:31:57 PST -------
All reviewed patches have been landed.  Closing bug.