Perf
A few little performance boosts:
- rather than creating new objects for each node in the AST, we augment them with the additional methods and properties we need
- as a corollary, we're able to only wrap object nodes, ignoring scalar values
- we avoid
.map
inwrap
, which is a very hot code path – instead we have a while loop - we avoid
Object.defineProperties
inNode
, preferring direct assignment (which is much faster)
Together, these shave about 30% off the time to compile a large file. But the even better news is that ff09af64 had a much more dramatic impact. The upshot is that we're looking at a 75-80% speedup since 0.8.2 – a task which previously took ~3 seconds (the same one that takes Babel 13.5 seconds) now takes 0.6-0.65 seconds.
So, yeah. Bublé 0.8.3 is over 20 times faster than Babel.