Here's a project i've setup to run some tests - https://github.com/rahulsom/perfcomp The code is based on Mr Haki's http://mrhaki.blogspot.com/2009/09/groovy-goodness-multimethods-or.html
This is the result of running my tests Environment =========== * Groovy: 2.4.3 * JVM: Java HotSpot(TM) 64-Bit Server VM (25.31-b07, Oracle Corporation) * JRE: 1.8.0_31 * Total Memory: 123 MB * Maximum Memory: 1820.5 MB * OS: Mac OS X (10.9.5, x86_64) Options ======= * Warm Up: Auto (- 60 sec) * CPU Time Measurement: On user system cpu real JApplication.java 13 0 13 13 JApplication.groovy 94 0 94 100 Application.java 426181 1584 427765 429254 Application.javaStatic 288418 918 289336 290410 Application.groovy 832317 2360 834677 837481 Application.groovyStatic 687717 2024 689741 697543 It looks like when Java executes the code, it's several orders of magnitude faster. Is there an option I can try tuning to improve groovy's odds in this comparison? I could get IDEA to run my Application.groovy. I couldn't get gradle to do that, possibly because there's java code depending on groovy code and groovy code depending on java code. Please ignore that if you want to play with the project. Appreciate any help/advice. R, rahul Rahul Somasunderam Engineer, Transcend Insights The information transmitted is intended only for the person or entity to which it is addressed and may contain CONFIDENTIAL material. If you receive this material/information in error, please contact the sender and delete or destroy the material/information.