Mustache.java benchmarks

75 views
Skip to first unread message

Sam

unread,
Jul 22, 2011, 2:10:38 PM7/22/11
to mustache.java
Did some benchmarking of MustacheBuilder and MustacheCompiler using
BenchmarkTest in the distribution. Also, there is a new JDK 7 branch
that uses MethodHandles rather than Reflection to call your backing
code. Here are the results:

MustacheBuilder Average
Reflection JDK 6 37,088 37,646 37,427 37,387
Reflection JDK 7 41,345 41,956 41,495 41,599
Method Handles 50,154 52,462 52,379 51,665

MustacheCompiler Average
Reflection JDK 6 35,238 35,086 34,824 35,049
Reflection JDK 7 40,078 40,081 40,032 40,064
Method Handles 41,362 46,629 44,222 44,071

What we see here is that Builder > Compiler, Handles > Reflection and
JDK 7 > JDK 6. Also, the compile time for Builder is around 10ms and
the compile time for Compiler is around 800ms. These tests were all
run on a 6-core MacPro using the latest JDK 6 from Apple and the
latest JDK 7 compiled from OpenJDK. With this result for JDK 7 I will
likely figure out a way to merge that change into the mainline and
still allow it to work with JDK 6.

Sam

Sam

unread,
Jul 24, 2011, 7:46:25 PM7/24/11
to mustache.java
This functionality is now integrated into the mainline. It detects
whether method handles are available at runtime and uses them if they
are available.

Sam
Reply all
Reply to author
Forward
0 new messages