Skip to content

perf: Improve module transforms#16882

Merged
nicolo-ribaudo merged 5 commits intobabel:mainfrom
liuxingbaoyu:perf-cjs
Oct 23, 2024
Merged

perf: Improve module transforms#16882
nicolo-ribaudo merged 5 commits intobabel:mainfrom
liuxingbaoyu:perf-cjs

Conversation

@liuxingbaoyu
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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 assert from "assert";
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
Copy Markdown
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
Copy Markdown
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
@github-actions github-actions Bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Jan 23, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jan 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area: modules outdated A closed issue/PR that is archived due to age. Recommended to make a new issue 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