What Is Closure Compiler?
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?"