Skip to content

Perf

username-removed-383729 requested to merge perf into master

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 in wrap, which is a very hot code path – instead we have a while loop
  • we avoid Object.defineProperties in Node, 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 ff09af64fc4686382b66e3791deafd4586fb61d9 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.

Merge request reports