Skip to content Skip to sidebar Skip to footer

What Is Closure Compiler?

If you have no idea what I am talking about, check this out: http://closure-compiler.appspot.com/home (it's a JavaScript minifier) On thier site, they state the following: The Cl

Solution 1:

Closure compiler will compile your code, and perform standard optimization techniques to your code.

The resulting code may or may not bear similarity when viewed superficially, but usually works exactly the same.


Solution 2:

https://developers.google.com/closure/compiler/docs/compilation_levels

The ADVANCED_OPTIMIZATIONS transformations include:

  • more aggressive renaming:
    Compilation with SIMPLE_OPTIMIZATIONS only renames parameters and variables within functions. ADVANCED_OPTIMIZATIONS also renames global variables, function names, and properties.

  • dead code removal:
    Compilation with ADVANCED_OPTIMIZATIONS removes code that is provably unreachable. This is especially useful in combination with large libraries. If you use only a few functions from a large library file, the compiler can remove everything except those functions from its output.

  • global inlining:
    Compilation with ADVANCED_OPTIMIZATIONS replaces some function calls with the body of the function. This transformation is known as "inlining". The compiler only inlines functions when it determines that inlining is safe and saves space. Compilation with ADVANCED_OPTIMIZATIONS also inlines constants and some variables when the compiler determines that it can do so safely.


Post a Comment for "What Is Closure Compiler?"