Skip to content

Optimize find referenced elements

Created by: nthykier

The biggest win (at least in my test case) is the "findReferencedElements: Handle referencingProps separately", which avoids a large number of unnecessary string operations.

But there is also a large potential in "Avoid recomputing findReferencedElements in removeUnusedDefs" for any SVG that need a number of calls to "removeUnreferencedElements" or where "removeUnusedDefs" recurses a lot of times. My particular test case does not seem to trigger any of that though (with a total of one call to removeUnreferencedElements)

Merge request reports

Loading