-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(typescript-estree): experimental option to cache type checking APIs #6426
Conversation
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 on https://opencollective.com/typescript-eslint. |
Codecov Report
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
Flags with carried forward coverage won't be shown. Click here to find out more.
|
What's the command you used to grab the hyperfine measurement? Do we have a bigger type-aware codebase we can test on? |
|
154811b
to
1b22295
Compare
✅ Deploy Preview for typescript-eslint ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
☁️ Nx Cloud ReportCI is running/has finished running commands for commit 3a8b206. 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 💌 from NxCloud. |
@bradzacher not-very-promising news on this:
I think it'd make sense to ship this change, since it's small and additive and labeled as |
This was unintentionally auto-closed when we merged the |
I'm more hopeful about the 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. |
PR Checklist
Overview
Applies a thin memoization layer on top of
getSymbolAtLocation
andgetTypeAtLocation
.hyperfine measurements are not very promising:
v6
eslint-plugin
21.467 s ± 0.096 s
21.465 s ± 0.121 s
26.675 s ± 0.096 s
typescript-estree
11.755 s ± 0.052 s
11.983 s ± 0.113 s
12.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 an
EXPERIMENTAL_
option so we can put this in v6 and get easier real world testing.Co-authored-by: @bradzacher