Skip to content
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

Do not use lookahead when parsing dynamic import or import.meta #9983

Merged
merged 1 commit into from May 15, 2019
Merged

Do not use lookahead when parsing dynamic import or import.meta #9983

merged 1 commit into from May 15, 2019

Conversation

danez
Copy link
Member

@danez danez commented May 15, 2019

Q                       A
Fixed Issues?
Patch: Bug Fix? n
Major: Breaking Change? n
Minor: New Feature? n
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT

see title

@danez danez added PR: Polish 💅 A type of pull request used for our changelog categories pkg: parser labels May 15, 2019
@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10792/

@danez
Copy link
Member Author

danez commented May 15, 2019

I also did some micro benchmark. The fixture is simple doing 30 dynamic imports and nothing else (babel/parser_performance@8e4139b#diff-76cb21823767258a7cf990de04ae5592).
Just wanted to make sure this is actually faster, even though probable nobody will notice it.

❯ node --expose-gc --max-old-space-size=2000 --max-semi-space-size=1500 --noconcurrent_sweeping index.js
Node: v12.2.0
Running benchmark for es6/import.js ...
┌───────────────┬───────────────────────────────┬────────────────────────────────┐
│ fixture       │ babel                         │ babelNew                       │
├───────────────┼───────────────────────────────┼────────────────────────────────┤
│ es6/import.js │ 6113 ops/sec ±0.53% (0.167ms) │ 10408 ops/sec ±0.52% (0.097ms) │
└───────────────┴───────────────────────────────┴────────────────────────────────┘

@danez danez merged commit 47eb1dd into babel:master May 15, 2019
@danez danez deleted the no-lookahead-import branch May 15, 2019 23:34
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: perf outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: parser PR: Polish 💅 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants