|
|
|
|
|
by githubr1
2313 days ago
|
|
constexpr - Cool project! For those of us with slow internet connections please change your Makefile to use a shallow clone: ```
github/three:
mkdir -p github
git clone --depth 1 https://github.com/mrdoob/three.js.git github/three -b r108
cd github/three && git checkout r108
``` This would save a couple of gigs and hours in download. Just skimming your code I see variable mangling but no AST optimizations, is that correct? Which is odd because you show similar output sizes to the JS bundlers. |
|
You probably aren't seeing the AST optimizations because they are actually in the parser. Search for "mangleSyntax" to find the optimization code.
This would normally be done in a separate pass but I'm trying to minimize the number of passes done over the full AST for speed. I figured it'd be faster to optimize the AST as it's parsed because the newly-created AST nodes are likely to still be in the CPU cache. That said, I haven't tested the performance impact of doing this. I just did this based on intuitions from performance work on previous compiler projects.