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

perf: Improve module transforms #16882

Merged
merged 5 commits into from
Oct 23, 2024
Merged

Conversation

liuxingbaoyu
Copy link
Member

@liuxingbaoyu liuxingbaoyu commented Oct 4, 2024

Q                       A
Fixed Issues? Fixes #1, Fixes #2
Patch: Bug Fix?
Major: Breaking Change?
Minor: New Feature?
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes?
License MIT
all/real-case-mjs-cjs.mjs ts-checker.mjs @ current: 1.08 ops/sec ±1.94% 30 runs (922ms)
all/real-case-mjs-cjs.mjs ts-checker.mjs @ baseline: 0.98 ops/sec ±2.04% 30 runs (1020ms)
all/real-case-mjs-cjs.mjs ts-parser.mjs @ current: 8.68 ops/sec ±5.66% 30 runs (115ms)
all/real-case-mjs-cjs.mjs ts-parser.mjs @ baseline: 8.06 ops/sec ±3.68% 30 runs (124ms)

The time was reduced by about 10%

@babel-bot
Copy link
Collaborator

babel-bot commented Oct 4, 2024

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

Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Failure is unrelated

@liuxingbaoyu liuxingbaoyu added PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories area: modules labels Oct 5, 2024
import { template, types as t } from "@babel/core";
import type { NodePath, Visitor, Scope } from "@babel/core";
import simplifyAccess from "@babel/helper-simple-access";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove this from package.json?

Also (in a follow up PR) I'd like for this package to be inlined inside plugin-transform-modules-commonjs, since now it's only used there.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sure! I would try removing it first since it introduces an extra traversal.

@nicolo-ribaudo nicolo-ribaudo merged commit 422c6d0 into babel:main Oct 23, 2024
52 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: modules PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants