Created attachment 203686 [details]
SVG nested use/symbol benchmark test
On chromium/chrome or rekonq executing the attached file takes at least 13 seconds or much more (depending on browser/version), while firefox does the same in 54 milliseconds on the same machine!!
Opening the attached file (svgbench.html) in different browsers produces the following results (total run time):
Firefox 21 (reference): 0.054 s
Chrome 14 (webkit 535.1): 13.650 s
Chrome 21 (webkit 537.1): 23.240 s
Chrome 27 (webkit 537.36): 26.250 s
Chrome 29 (webkit 537.36): 28.380 s
Rekonq 2.2.1 (KDE 4.10.2): 45.768 s
All the above tests where run on 32bit Ubuntu 13.04 on an Intel core-i7 class PC.
As can be seen, the performance differences with firefox are astronomical to say the least, and they are getting worse with every new version of webkit.
part0() creates 200 <symbol> tags with a <text> tag inside and appends them to the <defs> tag of the SVG.
part1() modifies the text content of each text tag.
part2() adds 200 more <symbol> tags, that each contain a <use> href to one of the previous <symbol> tags.
part3() again modifies the 200 <text> tags
part4() adds 200 <use> tags to the "mainsym" <symbol> href pointing to the symbols created in step 3. This makes all of the <text> tags become visible.
part5() again modifies the 200 <text> tags.
The first 4 functions execute very quickly all of the time. It's part4() and part5() that take huge amounts of time on webkit-based browsers.
This is causing problems for my application.
What's necessary to have this issue diagnosed / resolved?
Created attachment 209441 [details]
An SVG with lots of nesting
Added an example SVG from a chrome bug report - renders instantly in firefox, or over approx 15-20secs in chrome.
Vector.svg indeed renders much slower in chrome than in firefox, but I doubt this has anything to do with this particular problem, since Vector.svg does not have <use>/<symbol> nesting at all.