Closed dfreeman closed 9 years ago
@dfreeman we knew about the perf implications of moving into using esprima/recast, it is a matter of balance considering that we will be able to align with all esnext projects. we are committed to improve to a certain degree, and any help will that will be welcome. (/cc @benjamn creator of recast)
@caridy Makes sense. I'd be happy to put some time into this at some point, either in the transpiler or Recast, if @benjamn knows of any low-hanging fruit that would be good to ramp up on the codebase with :)
As a matter of fact, I have plans to eliminate the LocationFixer
entirely, now that these commits have been merged into Esprima:
https://github.com/ariya/esprima/commit/27d1d7740842a4a74c659b3b80b017d9855494c1
https://github.com/ariya/esprima/commit/233179e192c20a7c60554cfe1080198ba3df9892
https://github.com/ariya/esprima/commit/c8d226bf709353ccff9d9064fc3f864382ac9338
@benjamn nice!
LocationFixer
is gone (since recast@0.9.1)!
some what relevant to perfs: https://github.com/stefanpenner/basic-transpiler-benchmarks
https://github.com/esnext/es6-module-transpiler/blob/master/package.json#L45 seems to indicate at-least master of this project depends on a sufficiently new version of recast.
@dfreeman curious how the results are now.
@benjamn Nice! @stefanpenner I'm a little bit swamped at the moment, but should have some time over the weekend to take a look.
@dfreeman i would also like to add your scenario to my profile suite. I'll try to get to it this weekend swell.
Sorry for the slow turnaround; finally getting back to this. I'm consistently seeing numbers in the neighborhood of the following for the lodash source using http://jsbin.com/giwubilasa/4/edit?js,output
0.4.0: 13ms
0.8.0: 4417ms
0.9.6: 2089ms
Still slower than back in the old days, but it looks like more than half the time was shaved off between 0.8 (when I originally filed this) and 0.9.6 today, which is an awesome improvement :)
@dfreeman but still 5-10x to slow, hopefully we (including myself) will get more time to work on this to help improve. I have been unfortunately swamped with other work. I have put together: https://github.com/stefanpenner/basic-transpiler-benchmarks to help others make progress.
I've also been swamped with work, but @stefanpenner and @drslump have had some great ideas for further speedups (e.g. https://github.com/benjamn/ast-types/pull/81) that I'm really excited to merge as soon as I can give them a proper review.
I recommend you try http://esperantojs.org/ instead of this project. It's much faster, and it's where I'll be putting my efforts from here on.
I know this is a bit of an apples and oranges situation, since the overhaul that took place for 0.5 paved the way for a lot of great new functionality, but the actual transpilation process seems to be a couple orders of magnitude slower today than it was in 0.4.
I've thrown together a JSBin to run the two side by side. One sample run, for instance, on the lodash source took 23ms with 0.4.0, and over 6 seconds in 0.8.0.
I haven't dug in too deep, but a quick profiling run looks like most of the time is being spent in Recast, in particular in its
LocationFixer#fix
method.Is this the ballpark performance to expect moving forward, or have I drastically misconfigured something? It feels like this is prohibitively slow for rebuilds in a development environment. Regardless, thanks for your work on this project!