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

Optimization: skip one unnecessary checking in the loop #16438

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

shoonia
Copy link
Contributor

@shoonia shoonia commented Apr 19, 2024

In the 22 line, we check that the member param is the MemberExpression. We can initialize the nodes array with the property key, and start the loop with the first object

@babel-bot
Copy link
Collaborator

babel-bot commented Apr 19, 2024

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

@JLHwung
Copy link
Contributor

JLHwung commented Apr 19, 2024

Thank you for your contribution. Since this is an optimization PR, do you have benchmark to showcase the performance improvement? My personal guess is that it would be marginal, in which case the simplicity so that the code is easier to follow, might be preferred.

@nicolo-ribaudo nicolo-ribaudo added the PR: Performance 🏃‍♀️ A type of pull request used for our changelog categories label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
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.

None yet

4 participants