blackears / svgSalamander

154 stars 56 forks source link

Performance problem on OpenJDK11 when generating XMLReader #59

Closed benchpresser closed 4 years ago

benchpresser commented 4 years ago

Why the XMLReader reader is always generated in the SVGUniverse.java?

if we call SVGUniverse.loadSVG multiple times in an array, the block getXMLReader takes 1-2 ms in oracle jdk but 2000-3000ms on openjdk (Adopt 11.0.6.10) both on windows and linux environments (with openwebstart and with console invoke with java --)

I modified the code and generated a static common XMLReader and used that for all operations (no multithreading, provided that you do not use that instance by more than 1 threads), then it has the same performnce as oracle jdk.

blackears commented 4 years ago

https://github.com/blackears/svgSalamander/pull/61