Skip to content

[resolvers/webpack] [new] add cache option #3100

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

Merged
merged 1 commit into from
Nov 14, 2024

Conversation

seiyab
Copy link
Contributor

@seiyab seiyab commented Nov 13, 2024

Resolves #2746 to me.

eslint-import-resolver-webpack evaluates function config at every resolution. If it costs, this parameter helps.

with main branch:

Rule                 | Time (ms) | Relative
:--------------------|----------:|--------:
import/extensions    | 23930.926 |    83.4%
import/no-duplicates |  4757.780 |    16.6%

with this branch:

Rule                 | Time (ms) | Relative
:--------------------|----------:|--------:
import/extensions    |  3020.711 |    72.5%
import/no-duplicates |  1143.149 |    27.5%

I'm worrying whether we should add test in 608e81e or not. We can instantly add it reverting the commit.

@seiyab seiyab changed the title Add cache parameter into webpack resolver [New] Add cache parameter into webpack resolver Nov 13, 2024
@seiyab seiyab marked this pull request as ready for review November 13, 2024 03:53
@seiyab seiyab marked this pull request as draft November 13, 2024 03:54
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

Attention: Patch coverage is 14.28571% with 12 lines in your changes missing coverage. Please review.

Project coverage is 95.22%. Comparing base (67cc798) to head (fa676dd).

Files with missing lines Patch % Lines
resolvers/webpack/index.js 14.28% 12 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #3100       +/-   ##
===========================================
+ Coverage   81.99%   95.22%   +13.23%     
===========================================
  Files          94       83       -11     
  Lines        4154     3584      -570     
  Branches     1395     1252      -143     
===========================================
+ Hits         3406     3413        +7     
+ Misses        748      171      -577     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@seiyab seiyab marked this pull request as ready for review November 13, 2024 03:57
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.

Seems pretty good!

@ljharb ljharb changed the title [New] Add cache parameter into webpack resolver [resolvers/webpack] [new] add cache option Nov 14, 2024
@ljharb ljharb force-pushed the 2746-cached-webpack-resolver branch from fa676dd to ac7d396 Compare November 14, 2024 06:13
@ljharb ljharb merged commit ac7d396 into import-js:main Nov 14, 2024
340 of 341 checks passed
@seiyab seiyab deleted the 2746-cached-webpack-resolver branch November 14, 2024 07:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

import/no-duplicates performance slow
2 participants