This implements most of #110 — rather than mangling variables as a, b, c etc, the most common characters are used first. This results in slightly better gzip compression. As of this PR, Butternut more consistently generates smaller zipped output than Uglify in mangle-only mode. (Full credit for the idea belongs to Uglify.)
There's a little more we can do, e.g. sorting declarations by number of instances, but the hard part is done now.
(Edit: turns out sorting declarations by number of instances makes it worse. Man, gzip is a mysterious beast.)
This implements most of #110 — rather than mangling variables as
a
,b
,c
etc, the most common characters are used first. This results in slightly better gzip compression. As of this PR, Butternut more consistently generates smaller zipped output than Uglify in mangle-only mode. (Full credit for the idea belongs to Uglify.)There's a little more we can do, e.g.
sorting declarations by number of instances, but the hard part is done now.(Edit: turns out sorting declarations by number of instances makes it worse. Man, gzip is a mysterious beast.)