Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(typescript-estree): experimental option to cache type checking APIs#6426

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg commentedFeb 5, 2023
edited
Loading

PR Checklist

Overview

Applies a thin memoization layer on top ofgetSymbolAtLocation andgetTypeAtLocation.

hyperfine measurements are not very promising:

Packagev6Memoizing shortcut APIMemoizing type checker
eslint-plugin21.467 s ± 0.096 s21.465 s ± 0.121 s26.675 s ± 0.096 s
typescript-estree11.755 s ± 0.052 s11.983 s ± 0.113 s12.128 s ± 0.045 s

I'm betting I'll want to add caching around the native type checker (checker.getContextualType) too.

I'll probably want to add anEXPERIMENTAL_ option so we can put this in v6 and get easier real world testing.

Co-authored-by:@bradzacher

@JoshuaKGoldbergJoshuaKGoldberg added this to the6.0.0 milestoneFeb 5, 2023
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently onhttps://opencollective.com/typescript-eslint.

@nx-cloud
Copy link

nx-cloudbot commentedFeb 5, 2023
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit7c564ea. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
Node 18 - nx test typescript-estree
✅ Successfully ran 45 targets

Sent with 💌 fromNxCloud.

@JoshuaKGoldbergJoshuaKGoldberg changed the titleperf(typescript-estree): cache type checking APIsfeat(typescript-estree): cache type checking APIsFeb 5, 2023
@codecov
Copy link

codecovbot commentedFeb 5, 2023
edited
Loading

Codecov Report

Merging#6426 (3a8b206) intov6 (c036fe3) willdecrease coverage by0.09%.
The diff coverage is0.00%.

Additional details and impacted files
@@            Coverage Diff             @@##               v6    #6426      +/-   ##==========================================- Coverage   87.46%   87.38%   -0.09%==========================================  Files         374      374                Lines       12879    12891      +12       Branches     3811     3813       +2     ==========================================  Hits        11265    11265- Misses       1229     1241      +12  Partials      385      385
FlagCoverage Δ
unittest87.38% <0.00%> (-0.09%)⬇️

Flags with carried forward coverage won't be shown.Click here to find out more.

Impacted FilesCoverage Δ
...ages/typescript-estree/src/createParserServices.ts26.31% <0.00%> (-45.12%)⬇️
...pt-estree/src/parseSettings/createParseSettings.ts85.71% <ø> (ø)

@bradzacher
Copy link
Member

hyperfine measurements are not very promising:

What's the command you used to grab the hyperfine measurement?
I've been raw-dogging the entire codebase lint run via./node_modules/.bin/eslint . (to work around yarn and ensure i run eslint directly).

Do we have a bigger type-aware codebase we can test on?
Maybe we can just turn on every single rule in our codebase for the test run to increase the possibility of cache hits (I know we're fairly conservative in our type-aware linting ATM).

@JoshuaKGoldberg
Copy link
MemberAuthor

JoshuaKGoldberg commentedFeb 14, 2023
edited
Loading

yarn lint --skip-nx-cache - it's deep in the edit history. I do want to do more thorough checking, including on the codebase as a whole. And there might be more type checker APIs that should be cached. I like the turning on every rule, good idea!

@JoshuaKGoldbergJoshuaKGoldberg removed this from the6.0.0 milestoneFeb 23, 2023
@bradzacherbradzacher modified the milestones:6.0.0,7.0.0Mar 6, 2023
@bradzacherbradzacherforce-pushed thev6 branch 6 times, most recently from154811b to1b22295CompareMarch 15, 2023 10:00
@bradzacherbradzacher added the enhancementNew feature or request labelMar 15, 2023
@netlify
Copy link

netlifybot commentedApr 5, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit3a8b206
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/642db4d6f2fa4100085a20b0
😎 Deploy Previewhttps://deploy-preview-6426--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to yourNetlify site settings.

@nx-cloud
Copy link

nx-cloudbot commentedApr 5, 2023
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit3a8b206. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 30 targets

Sent with 💌 fromNxCloud.

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat(typescript-estree): cache type checking APIsfeat(typescript-estree): experimental option to cache type checking APIsApr 5, 2023
@JoshuaKGoldberg
Copy link
MemberAuthor

@bradzacher not-very-promising news on this:

  • Runningtime MEMOIZE_TYPE_CHECKING_APIS=true yarn lint --skip-nx-cache takes ~60 seconds for me - same astime yarn lint
  • Runningtime MEMOIZE_TYPE_CHECKING_APIS=true yarn lint-many runs out of memory (instead of taking ~110 seconds)

I think it'd make sense to ship this change, since it's small and additive and labeled asEXPERIMENTAL_. Thoughts?

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewApril 5, 2023 17:49
@JoshuaKGoldbergJoshuaKGoldberg deleted the branchtypescript-eslint:mainJuly 10, 2023 17:52
@JoshuaKGoldberg
Copy link
MemberAuthor

This was unintentionally auto-closed when we merged thev6 branch 🙃 it'll be recreated.

@JoshuaKGoldbergJoshuaKGoldberg changed the base branch fromv6 tomainJuly 10, 2023 21:11
@JoshuaKGoldberg
Copy link
MemberAuthor

I'm more hopeful about theEXPERIMENTAL_useProjectService parser option (#6754). Closing this for now.

If someone does think this PR would benefit them, feel free to post an explanation why! We can always re-open - or even better,you the reader can open it and take ownership.

@JoshuaKGoldbergJoshuaKGoldberg deleted the cache-type-checking-apis branchJuly 17, 2023 19:29
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsJul 25, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers
No reviews
Assignees
No one assigned
Labels
enhancementNew feature or request
Projects
None yet
Milestone
8.0.0
Development

Successfully merging this pull request may close these issues.

Enhancement: Investigate caching type checking APIs
2 participants
@JoshuaKGoldberg@bradzacher

[8]ページ先頭

©2009-2025 Movatter.jp