Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there an equivalent to Google Closure's optimisations for javascript, for Java?

We see in the following blog entry: http://blog.fogus.me/2011/07/21/compiling-clojure-to-javascript-pt1/ some pretty incredible syntax transformations, simplifications done to the javascript programming language, done by the Google Closure compiler.

My question is - is there something that provides these kinds of syntactic transformations for Java?

like image 788
hawkeye Avatar asked Aug 17 '26 23:08

hawkeye


1 Answers

The Closure compiler works the way it does because JavaScript, unlike Java, is typically distributed in source form. So doing things like renaming variables and eliminating whitespace don't apply to Java, since Java applications are typically distributed as bytecode (often packaged in JAR files).

As for the rest of the optimization, the Java compiler and Hotspot JVM itself incorporate a number of techniques that are very good at optimizing your application and improving performance: many of them just happen without you knowing that they're there.

like image 130
Jeremy Roman Avatar answered Aug 20 '26 13:08

Jeremy Roman