block by Rich-Harris d493abd4e3e27c4731c92353b3f49c18

V8 lazy parsing slowdown test case

Full Screen

Via mrdoob/three.js#9310 and rollup/rollup#774 – V8’s lazy parsing of function expressions is causing Three.js r80 to take ~4x as long to parse as r79. By wrapping the UMD factory function expression in parentheses (see lines 6 and 40881 of the two attached files) we can prevent the function expression from being lazily parsed, with the result that r80 parses faster than r79.

Live demo: https://ns-valtrxdwwc.now.sh/

index.html

open the console...

<script src='r80-fixed.js'></script>
<script>
	delete window.THREE;
</script>
<script src='r80.js'></script>

r80.js