You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-dev@xmlgraphics.apache.org by dv...@computer.org on 2005/03/25 14:14:35 UTC

init squiggle

Hi there,

i ran squiggle in a profiler and was stunned to see 90000 invocations of 
Math.pow() 
for an empty blank image.
It turned out that an (invisible ) 'init.svg' is loaded and rendered 
during initialization of the app.
I guess, that is done to touch and preload all classes.
Isnt there a cheaper way ( with just 80000 Math.pow() ... ) to do this ??

Or maybe it was just forgotten... 

dvholten

Re: init squiggle

Posted by Thomas DeWeese <Th...@Kodak.com>.
dvholten@computer.org wrote:

> i ran squiggle in a profiler and was stunned to see 90000 invocations of 
> Math.pow()
> for an empty blank image.
> It turned out that an (invisible ) 'init.svg' is loaded and rendered 
> during initialization of the app.

    Yes, this is to load most of the Java classes needed for
the renderer to run.

> I guess, that is done to touch and preload all classes.
> Isnt there a cheaper way ( with just 80000 Math.pow() ... ) to do this ??

   The init.svg used the specular lighting filter which does a pow for
each pixel - hence the 90,000 invocations. I've replaced it with a bit
simpler filter.  Thanks for pointing this out.

   The render time for the original as ~200-300ms the new one is
60-80ms.  So you save perhaps a 1/5 of a sec ;)

> Or maybe it was just forgotten...
> 
> dvholten


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-dev-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-dev-help@xmlgraphics.apache.org