Skip to content

Comment on Advances in Obfuscationparent

Comments

For Google products, huge gains come from running an optimizing compilation (Closure Compiler) which dramatically rearranges Javascript the same way GCC rearranges C into assembly.

It is not always true that minifying method names is the same as gzip, as a good minifier will understand scopes and arrange many of the variables to have both the same name and smaller distances between like symbols. This shifts the frequency distribution of the symbols as well as the distances allowing the huffman coding to be more optimal.

The Closure Compiler on ADVANCED_OPTIMIZATIONS mode is a terrifying beast and only works on carefully-crafted code. It makes some astonishing optimizations, though.

I encourage JS developers who strongly believe in distributing source along with their webapps to use source maps instead of delivering slow, unminified code. They are only downloaded when a user opens the web inspector (no overhead for regular users) and provide transparent access to source as if it had been delivered instead.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.