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(linter): optimize no-dupe-keys #4292

Merged
merged 1 commit into from
Jul 16, 2024
Merged

Conversation

lucab
Copy link
Collaborator

@lucab lucab commented Jul 16, 2024

This tweaks the no-dupe-keys lint in order to try to optimize it.
The lints reliably shows up in both CPU and memory profiling,
due to the cost of allocating/growing the hashmap and hashing into it.
This PR tries to tackle both by skipping trivial cases and by
pre-allocating a larger hashmap.

Copy link

graphite-app bot commented Jul 16, 2024

Your org has enabled the Graphite merge queue for merging into main

Add the label “merge” to the PR and Graphite will automatically add it to the merge queue when it’s ready to merge. Or use the label “hotfix” to add to the merge queue as a hot fix.

You must have a Graphite account and log in to Graphite in order to use the merge queue. Sign up using this link.

Copy link
Collaborator Author

lucab commented Jul 16, 2024

This stack of pull requests is managed by Graphite. Learn more about stacking.

Join @lucab and the rest of your teammates on Graphite Graphite

@github-actions github-actions bot added the A-linter Area - Linter label Jul 16, 2024
Copy link

codspeed-hq bot commented Jul 16, 2024

CodSpeed Performance Report

Merging #4292 will not alter performance

Comparing ups/linter-perf-no-dupe-keys (0fdc88b) with main (c5731a5)

Summary

✅ 32 untouched benchmarks

@lucab lucab marked this pull request as ready for review July 16, 2024 09:40
@Boshen Boshen added the 0-merge Merge with Graphite Merge Queue label Jul 16, 2024
Copy link

graphite-app bot commented Jul 16, 2024

Merge activity

  • Jul 16, 7:07 AM EDT: The merge label 'merge' was detected. This PR will be added to the Graphite merge queue once it meets the requirements.
  • Jul 16, 7:07 AM EDT: Boshen added this pull request to the Graphite merge queue.
  • Jul 16, 7:12 AM EDT: Boshen merged this pull request with the Graphite merge queue.

This tweaks the `no-dupe-keys` lint in order to try to optimize it.
The lints reliably shows up in both CPU and memory profiling,
due to the cost of allocating/growing the hashmap and hashing into it.
This PR tries to tackle both by skipping trivial cases and by
pre-allocating a larger hashmap.
@Boshen Boshen force-pushed the ups/linter-perf-no-dupe-keys branch from 9bd48e5 to 0fdc88b Compare July 16, 2024 11:08
@graphite-app graphite-app bot merged commit 0fdc88b into main Jul 16, 2024
26 checks passed
@graphite-app graphite-app bot deleted the ups/linter-perf-no-dupe-keys branch July 16, 2024 11:12
@github-actions github-actions bot mentioned this pull request Jul 17, 2024
Boshen added a commit that referenced this pull request Jul 17, 2024
## [0.6.1] - 2024-07-17

### Features

- 83c2c62 codegen: Add option for choosing quotes; remove slow
`choose_quot` method (#4219) (Boshen)
- 1f8968a linter: Add eslint-plugin-promise rules: avoid-new,
no-new-statics, params-names (#4293) (Jelle van der Waa)
- a4dc56c linter: Add fixer for
unicorn/no_useless_promise_resolve_reject (#4244) (Burlin)
- 6fb808f linter: Add typescript-eslint/no-confusing-non-null-assertion
(#4224) (Jaden Rodriguez)
- 126b66c linter: Support eslint-plugin-vitest/valid-describe-callback
(#4185) (cinchen)
- 05b9a73 linter: Support eslint-plugin-vitest/valid-expect (#4183)
(cinchen)
- 3e56b2b linter: Support eslint-plugin-vitest/no-test-prefixes (#4182)
(cinchen)
- 3016f03 linter: Let fixer functions return a `None` fix (#4210)
(DonIsaac)
- bbe6137 linter: Implement unicorn/no-useless-undefined (#4079)
(Burlin)
- 20cdb1f semantic: Align class scope with typescript (#4195) (Dunqing)

### Bug Fixes

- 9df60da linter: Correct find first non whitespace logic in
@typescript-eslint/consistent-type-imports (#4198) (mysteryven)
- 67240dc linter: Not ignore adjacent spans when fixing (#4217)
(mysteryven)
- dd07a54 linter: Global variables should always check the builtin
variables (#4209) (Jelle van der Waa)
- 351ecf2 semantic: Incorrect resolve references for `TSTypeQuery`
(#4310) (Dunqing)
- 1108f2a semantic: Resolve references to the incorrect symbol (#4280)
(Dunqing)

### Performance

- 0fdc88b linter: Optimize no-dupe-keys (#4292) (lucab)

### Refactor

- 2c7bb9f ast: Pass final `ScopeFlags` into `visit_function` (#4283)
(overlookmotel)
- aa22073 codegen: Improve print API (#4196) (Boshen)
- b5a8f3c linter: Use get_first_parameter_name from unicorn utils
(#4255) (Jelle van der Waa)
- 7089a3d linter: Split up fixer code into separate files (#4222)
(DonIsaac)
- ace4f1f semantic: Update the order of `visit_function` and `Visit`
fields in the builder to be consistent (#4248) (Dunqing)
- 7f1addd semantic: Correct scope in CatchClause (#4192) (Dunqing)

Co-authored-by: Boshen <Boshen@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0-merge Merge with Graphite Merge Queue A-linter Area - Linter
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants