nolanlawson / optimize-js

Optimize a JS file for faster parsing (UNMAINTAINED)
https://nolanlawson.github.io/optimize-js
Apache License 2.0
3.75k stars 104 forks source link

Is the readme correct? #43

Open kurtextrem opened 7 years ago

kurtextrem commented 7 years ago

https://docs.google.com/presentation/d/1214p4CFjsF-NY4z9in0GEcJtjbyVQgU0A-UqEvovzCs/edit#slide=id.g192721b519_1_40 this suggests V8 doesn't only look for (, but only for (function(){})() (see slide 24)

HorkyChen commented 7 years ago

That looks like V8 had already finished some optimizations.

Same as this issue, I double checked latest implementation of V8, below pattern will be treated as "likely to be called" and should do eagerly parsing: !function (){}()

Below is the related review: Treat a '!' preceding a function literal as eager-compile hint.