UglifyJS icon indicating copy to clipboard operation
UglifyJS copied to clipboard

Doc: "keep_infinity" is redundant on modern Chrome

Open robpalme opened this issue 7 years ago • 6 comments

Clarify that "keep_infinity" compress option is only useful for older versions of Chrome.

The initial performance assessment that concluded Infinity was faster than 1/0 was based on Chrome 57. https://github.com/mishoo/UglifyJS2/pull/1723#issuecomment-290122814

Chrome 63 suffers no such degradation. https://jsperf.com/infinity-vs-1-0-v2-0

robpalme avatar Jan 07 '18 14:01 robpalme

/cc @kzc

alexlamsl avatar Jan 07 '18 14:01 alexlamsl

Chrome no longer penalizes 1/0 over Infinity, but it's interesting to note that the benchmark runs 2.5X faster in Safari.

The default is:

        keep_infinity : false,

No harm keeping the option.

kzc avatar Jan 07 '18 16:01 kzc

Not that having more options is bad, but does anyone out there actually switches this on?

alfaproject avatar Jan 07 '18 17:01 alfaproject

I noticed @std/esm was using keep_infinity which initially sparked my curiosity.

https://github.com/standard-things/esm/blob/master/.uglifyrc

On 7 Jan 2018 5:38 pm, "João Dias" [email protected] wrote:

Not that having more options is bad, but does anyone out there actually switches this on?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/mishoo/UglifyJS2/pull/2743#issuecomment-355838798, or mute the thread https://github.com/notifications/unsubscribe-auth/AGni9bTKzmbyIaZVbjoKAeSWBN3IRWHnks5tIQEJgaJpZM4RVqhb .

robpalme avatar Jan 07 '18 17:01 robpalme

They don't even use Infinity. (;

alfaproject avatar Jan 07 '18 20:01 alfaproject

They don't even use Infinity. (;

Maintainer of @std/esm here: We minify our bundle which includes parts of libraries, like acorn, that do use Infinity.

jdalton avatar Jan 25 '18 19:01 jdalton