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(es/lints): Avoid needless allocations in no-dupe-args #9041

Merged
merged 14 commits into from
Jun 14, 2024

Conversation

kdy1
Copy link
Member

@kdy1 kdy1 commented Jun 12, 2024

Description:

I introduced a zero-allocation variant for swc_ecma_utils::DestructuringFinder that does not allocate anything.

Related issue (if exists):

@kdy1 kdy1 added this to the Planned milestone Jun 12, 2024
@kdy1 kdy1 self-assigned this Jun 12, 2024
Copy link
Member Author

@kdy1 kdy1 left a comment

Choose a reason for hiding this comment

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

swc-bump:

  • swc_ecma_lints
  • swc_ecma_utils
  • swc_core

@kdy1 kdy1 marked this pull request as ready for review June 12, 2024 07:36
@kdy1 kdy1 requested a review from a team as a code owner June 12, 2024 07:36
kodiakhq[bot]
kodiakhq bot previously approved these changes Jun 12, 2024
@kdy1 kdy1 enabled auto-merge (squash) June 12, 2024 07:37
Comment on lines +15 to +16
/// This has time complexity of O(n^2), but it's fine as the number of paramters
/// is usually small.
Copy link

Choose a reason for hiding this comment

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

This probably holds true for 99.9%, but maybe we can add another implementation that is used for n > 100 based on a hashmap.

Copy link
Collaborator

@swc-bot swc-bot left a comment

Choose a reason for hiding this comment

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

Automated review comment generated by auto-rebase script

@kdy1 kdy1 disabled auto-merge June 12, 2024 07:47
kodiakhq[bot]
kodiakhq bot previously approved these changes Jun 12, 2024
.struct_span_err(
id2.span,
&format!(
"the name `{}` is bound more than once in this parameter list",
Copy link

Choose a reason for hiding this comment

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

If a binding is defined 3 times this error will be reported multiple times. That was already the case with the old implementation.

Copy link
Member Author

Choose a reason for hiding this comment

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

That's handled by done. Actually I added done just to match the original behavior.

@kdy1 kdy1 requested a review from sokra June 12, 2024 07:49
kodiakhq[bot]
kodiakhq bot previously approved these changes Jun 12, 2024
@kdy1 kdy1 merged commit e560198 into swc-project:main Jun 14, 2024
148 checks passed
@kdy1 kdy1 deleted the perf-vc branch June 14, 2024 05:39
@kdy1 kdy1 modified the milestones: Planned, v1.6.0 Jun 16, 2024
@swc-project swc-project locked as resolved and limited conversation to collaborators Jul 16, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants