Efficient implementation of closures on JVM

Behrang Saeedzadeh behrangsa at gmail.com
Thu Dec 1 00:19:26 PST 2011


Hi,

A few days ago I was reading an article about how excessive usage of
closures has hindered compilation time, performance, and memory usage of a
Scala application that has forced replacing the usage of closures with
alternative code that's not using closures. In short, looks like this is
happening because for each closure, a new anonymous inner class and hence
.class should be generated and loaded that lead to the aforementioned
problems.

I was wondering if the implementation of closures that's due to be added to
Java 8 will have similar problems or if there are plans to make changes to
the VM to make it possible implement closures in a more efficient way?

Cheers,
Behrang Saeedzadeh
http://www.behrang.org


More information about the lambda-dev mailing list