Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How much will JSR-292 (invokedynamic) do to Groovy performance?

Is there an estimate that says how much JSR-292 will impact Groovy performance?

like image 541
Kimble Avatar asked Jan 06 '10 06:01

Kimble


3 Answers

invokedynamic is a complicated story really, since the performance characteristics changes all the time in JDK7. During porting Groovy to indy I got really, really near Java, about factor 1.5. But I have to use the catchExceptionGuard, which reduces performance to something like being factor 3-4. We still need to investigate ways to avoid having to use that guard. Maybe we will have to break some existing code in Groovy 2.2 for that. Anyway, I don't need the guard for the invokeMethod fallback as mentioned above. It is for GroovyRuntimeExceptions possibly containing other exceptions, that I have to unwrap or do other things with. So the theoretical possible performance seems to be between Java and half of Java speed for existing methods. Performance of calls to invokeMethod is a whole different story.

If you need more, then use @CompileStatic in Groovy 2.0.

like image 181
blackdrag Avatar answered Nov 12 '22 01:11

blackdrag


I don't think there is a benchmark yet, and until someone performs it we can only guess...

You may find this post in this matter interesting.

like image 35
David Rabinowitz Avatar answered Nov 12 '22 02:11

David Rabinowitz


It would be around 10-50 times faster in general.

http://www.mail-archive.com/[email protected]/msg00819.html

like image 2
chanwit Avatar answered Nov 12 '22 01:11

chanwit