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

fix(eslint-plugin): [no-misused-promises] perf: avoid getting types of variables/functions if the annotated type is obviously not a function#9656

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

Merged
bradzacher merged 3 commits intov8frombjz/no-misused-promises-perf-tweak
Jul 29, 2024

Conversation

bradzacher
Copy link
Member

Overview

I sat down for a few minutes to try perf profiling our codebase (writeup coming slowly in#6366) to look for some obvious improvements.

One thing that immediately stood out was that almost 10% of our lint run was spent inno-misused-promises'checkVariableDeclaration function. We can fix this easily by doing a quick syntactic check to filter out cases of (a) not-annotated variables and (b) annotated types that can never be function types.

This completely removes the function from the left-heavy cpu profile flame graph.

It ultimately doesn't change the lint run performance, however, because types are lazily calculated - so it has only shifted the workload to another rule -- but if we can do this enough we can shift that needle.

JoshuaKGoldberg and kirkwaiblinger reacted with thumbs up emoji
…f variables/functions if the annotated type is obviously not a function
@bradzacherbradzacher added the performanceIssues regarding performance labelJul 29, 2024
@typescript-eslint
Copy link
Contributor

Thanks for the PR,@bradzacher!

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.

@netlifyNetlify
Copy link

netlifybot commentedJul 29, 2024
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit37b85c7
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/66a6ec39dca98900085ba626
😎 Deploy Previewhttps://deploy-preview-9656--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (🟢 up 1 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

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

@nx-cloudNx Cloud
Copy link

nx-cloudbot commentedJul 29, 2024
edited
Loading

☁️ Nx Cloud Report

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

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 2 targets

Sent with 💌 fromNxCloud.

@codecovCodecov
Copy link

codecovbot commentedJul 29, 2024
edited
Loading

Codecov Report

Attention: Patch coverage is94.11765% with1 line in your changes missing coverage. Please review.

Project coverage is 88.05%. Comparing base(f38728c) to head(7e3ff4a).
Report is 1 commits behind head on v8.

Current head7e3ff4a differs from pull request most recent head37b85c7

Pleaseupload reports for the commit37b85c7 to get more accurate results.

Additional details and impacted files
@@           Coverage Diff           @@##               v8    #9656   +/-   ##=======================================  Coverage   88.04%   88.05%           =======================================  Files         402      402             Lines       13639    13655   +16       Branches     3959     3966    +7     =======================================+ Hits        12009    12024   +15  Misses       1322     1322- Partials      308      309    +1
FlagCoverage Δ
unittest88.05% <94.11%> (+<0.01%)⬆️

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

FilesCoverage Δ
...ges/eslint-plugin/src/rules/no-misused-promises.ts97.18% <94.11%> (-0.28%)⬇️

Choose a reason for hiding this comment

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

(merge shenanigan)

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

nah i added this cos I was running from the root withnode --cpu-prof --max-old-space-size=10000 ./node_modules/.bin/eslint . and our lint run was matching reporting on files in these two folders.

the/ should make eslint ignore the entire folder without globbing etc

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Awesome! ⚡

@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelJul 29, 2024
@bradzacherbradzacher merged commit37c10e8 intov8Jul 29, 2024
57 of 58 checks passed
@bradzacherbradzacher deleted the bjz/no-misused-promises-perf-tweak branchJuly 29, 2024 07:18
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsAug 7, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees
No one assigned
Labels
1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we mergeperformanceIssues regarding performance
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@bradzacher@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp