New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance and memory usage? #1896

Closed
ghost opened this Issue Dec 17, 2017 · 3 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Dec 17, 2017

I noticed that Esprima are approx 26% slower than the Cherow parser, and around 52% slower when it comes to parsing huge libraries (more than 10 000 lines of code)

I also compared against Acorn, and even on small libraries it seems that Acorn are faster in a few cases.

If I run the same tests over and over again the difference in performance between Acorn and Esprima are very clear. This for libraries such as Rollup, Angular 1.6 and even Esprima itself.
For smaller libraries less than 1000 lines, the difference in performance between Acorn and Esprima are minimal. Almost non-existing.

I further checked the memory usage, and for larger libraries such as TypeScript 2.6.2 and React 16, Esprima eat a lot of RAM. You can measure this yourself.

Any plans to improve this?

@ariya

This comment has been minimized.

Show comment
Hide comment
@ariya

ariya May 29, 2018

Contributor

Closing this for the lack of concrete follow-up.

Contributor

ariya commented May 29, 2018

Closing this for the lack of concrete follow-up.

@ariya ariya closed this May 29, 2018

@KFlash

This comment has been minimized.

Show comment
Hide comment
@KFlash

KFlash May 30, 2018

I come across this issue, and I think it's enough to run any online benchmark to get to the point.

Desktop computer:

bench

Mobile:

mobile

As you can see.. Acorn is for the most part equal in performance except for mobile devices, but both seems to suffers from miserable performance on mobile devices and when parsing libraries like TypeScript (I may think it's around 90k line of code),

KFlash commented May 30, 2018

I come across this issue, and I think it's enough to run any online benchmark to get to the point.

Desktop computer:

bench

Mobile:

mobile

As you can see.. Acorn is for the most part equal in performance except for mobile devices, but both seems to suffers from miserable performance on mobile devices and when parsing libraries like TypeScript (I may think it's around 90k line of code),

@KFlash

This comment has been minimized.

Show comment
Hide comment
@KFlash

KFlash May 30, 2018

The previous benchmarks was done in Chrome. Here is another one I ran with the Microsoft Edge browser.

edge

Esprima is faster than Acorn in this benchmark.

KFlash commented May 30, 2018

The previous benchmarks was done in Chrome. Here is another one I ran with the Microsoft Edge browser.

edge

Esprima is faster than Acorn in this benchmark.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment