closure-compiler
closure-compiler copied to clipboard
Replace array-join by native string concats
Hello,
as closure compiler optimizes for a good gzip compression ratio and a trivial benchmark revealed a 28x performance increase on v8 and couple percent on Firefox by replacing
[a, b, c].join(" ")
with
a + " " + b + " " + c
I would propose to transform the array-join approach (which is much more readable, easier to type and often used in libraries) to a more verbose native string concat. This provokes a bigger uncompressed file, but generates nice repeated patterns for gzip.
Thanks Robert