Closed
Bug 244975
Opened 21 years ago
Closed 8 years ago
Deeply nested hierarchies are too slow (GetOwnerSVGElement, GetCTM & GetScreenCTM)
Categories
(Core :: SVG, defect)
Tracking
()
RESOLVED
WONTFIX
People
(Reporter: alex, Unassigned)
References
Details
(Keywords: perf)
I did some profiling on adding an svg elements to deeply nested groups.
For my debug build I get
(0.143 +/- 0.006) ms for adding a <circle> to a single <svg> element and
(3.103 +/- 0.090) ms for adding a <circle> to the innermost element in a tree of
1000 <g>'s.
In fact the time grows linearly with the nesting level.
The most likely culprit is our implementation of GetOwnerSVGElement() which
gets called by most graphics elements when the parent chain changes (e.g. when
they get appended to other content). The current implementation of that method
just walks the parent chain until it encounters the owner svg element.
I think we should change it so that for non-container elements it calls
GetOwnerSVGElement() on its parent and for container elements (<g>) it returns a
cached pointer.
The same goes for GetCTM and GetScreenCTM.
| Reporter | ||
Comment 1•21 years ago
|
||
The situation is even worse on deleting.
Deleting an <svg>-element scales quadratically with the number of nested
elements it contains :-(
Updated•21 years ago
|
Assignee: alex → jonathan.watt
Updated•21 years ago
|
Status: NEW → ASSIGNED
Comment 2•20 years ago
|
||
Is this a big problem in real life? That is, do SVG trees commonly get this deep?
| Reporter | ||
Comment 3•20 years ago
|
||
No, SVGs tend to be relatively shallow (depth<<10), so I don't think this is a
significant factor in practice.
Updated•20 years ago
|
Assignee: jonathan.watt → general
Status: ASSIGNED → NEW
Updated•16 years ago
|
Assignee: general → nobody
QA Contact: ian → general
Updated•8 years ago
|
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → WONTFIX
You need to log in
before you can comment on or make changes to this bug.
Description
•