The latest Sun JDK 6 <http://java.sun.com/javase/6/webnotes/6u14.html> has optional performance optimization for threading. Since Xwiki running in a web-container is thread-intensive, I'm wondering whether performance improvements like Escape Analysis<http://en.wikipedia.org/wiki/Escape_analysis> will be noticed for Xwiki. How about for its increasing amount of work happening out of Groovy scripts? Much attention has been given by Sun, IBM, BEA and others to optimize lock
management and synchronization in their respective Java 6 virtual machine offerings. Features like biased locking, lock coarsening, lock elision by escape analysis and adaptive spin locking are all designed to increase concurrency by allowing more effective sharing amongst application threads.
http://www.infoq.com/articles/java-threading-optimizations-p1 http://www.infoq.com/articles/java-threading-optimizations-p2 http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/ http://blog.xebia.com/2009/02/18/jvm-threading-optimizations-revisited/ http://blog.juma.me.uk/2008/12/17/objects-with-no-allocation-overhead/ <http://blog.xebia.com/2007/12/21/did-escape-analysis-escape-from-java-6/> http://java.dzone.com/articles/escape-analysis-java-6-update <http://java.dzone.com/articles/escape-analysis-java-6-update> Niels http://nielsmayer.com PS: I need to try this experiment again with the non-early access version http://nielsmayer.com/xwiki/bin/view/fedora10/64bitJavaAppletIn64BitFirefox#... PPS: in clojure land (will this also apply to Groovy?) http://www.mail-archive.com/[email protected]/msg17221.html
I'm getting a very significant performance improvement by adding a couple of JVM parameters (using jdk 1.6.0_14). They are:
-XX:+DoEscapeAnalysis
-XX:+UseBiasedLocking (I think the -server flag is required for those two flags to do anything).
...
My runtime with n = 5,000,000 goes from ~7.5 seconds to ~4.5 seconds.
... I actually just confirmed that, on my computer at least, those flags have
basically no effect on the java version and a big difference on the clojure one.
... -XX:+AggressiveOpts improves another 5-10%.