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

[Refactor] no-*-set-state: improve performance #3272

Merged
merged 1 commit into from Apr 16, 2022

Conversation

golopot
Copy link
Contributor

@golopot golopot commented Apr 16, 2022

❌ Early return on CallExpression
✔️ Early return on rule creation

Benchmark:

- react/no-did-mount-set-state               |   602.202 |     4.5%
- react/no-did-update-set-state              |   302.628 |     2.3%
- react/no-will-update-set-state             |    10.411 |     0.1%
+ react/no-did-mount-set-state               |     7.566 |     0.1%
+ react/no-will-update-set-state             |     4.627 |     0.0%
+ react/no-did-update-set-state              |     3.381 |     0.0%

@codecov
Copy link

codecov bot commented Apr 16, 2022

Codecov Report

Merging #3272 (2bf54d7) into master (7e4c2c2) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3272   +/-   ##
=======================================
  Coverage   97.68%   97.68%           
=======================================
  Files         121      121           
  Lines        8592     8592           
  Branches     3127     3127           
=======================================
  Hits         8393     8393           
  Misses        199      199           
Impacted Files Coverage Δ
lib/util/makeNoMethodSetStateRule.js 97.87% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7e4c2c2...2bf54d7. Read the comment docs.

Copy link
Member

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

(-‸ლ)

@ljharb ljharb merged commit 2bf54d7 into jsx-eslint:master Apr 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants