Terminology:
IIFE: (function() { code })()
PIFE: (function() { code })
Since IIFE detection would be too slow, JavaScript engines detect PIFEs to decide whether to eagerly parse + compile functions that are needed, boosting startup times.
https://v8.dev/blog/preparser
-
Show this thread
-
Replying to @mathias
Interesting! Do you know if any browsers hash/memoize compilation of super common FEs like Google's famous `(function(i,s,o,g,r,a,m)...`? Or if it'd even be worth doing so?
1 reply 0 retweets 0 likes
Replying to @padolsey
V8 doesn’t special-case any particular function expressions in this way, no. We focus on optimizations that apply more generally, so that we don’t need to.
7:03 AM - 16 Apr 2019
0 replies
0 retweets
1 like
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
JavaScript, HTML, CSS, HTTP, performance, security, Bash, Unicode, i18n, macOS.