Re: Rendering of deeply-nested shapes with <use>

Hello

This is an interesting problem so I've make a quick scripted test to see
what's happen when there are deep nested "use" elements (see the
attachment).
This use case is a bit different than the Sierpinski carpet's issue but have
similar concern.

This test is a simple loop that produce the following SVG output on each
loop :

<g>
    <use xlink:href="#priviousGElement"/>
    <rect/>
    <text>loop number</text>
</g>

each G element include the previous G element through the USE element

To increase the deep of the test, you just have to change the value of the
JS variable "deep" (for convenient reason, there is also a lineLength
variable to perform some visual line break on the test)

After some quick test, it appear that :

   - Firefox 4 (minefield) hang significantly after a deep value of 100 but
   is able to render all the elements even with more than 300 nested USE
   elements (but it is completely freezed for a loooong time)
   - Chrome 9 do not hang but refuse to render more than 146 nested USE
   elements
   - Opera 11 hang significantly after a deep value of 200 but is able to
   render an amazing number of nested USE elements (I've try up to 600) with
   acceptable freezing time.

This is definitely not a real world scenario but there is place for
optimization here

Hope that help.
-- 
Jeremie
.............................
Web : http://jeremie.patonnier.net
Twitter : @JeremiePat <http://twitter.com/JeremiePat>

Received on Wednesday, 16 February 2011 14:21:35 UTC