Skip to content

perf: hunt down more serial awaits#2350

Merged
JoshuaKGoldberg merged 1 commit intomainfrom
perf2
Mar 18, 2026
Merged

perf: hunt down more serial awaits#2350
JoshuaKGoldberg merged 1 commit intomainfrom
perf2

Conversation

@lishaduck
Copy link
Member

PR Checklist

Overview

#2343 but more of it and automated and failing CI rn.

@vercel
Copy link

vercel bot commented Feb 23, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
flint Ready Ready Preview, Comment Mar 13, 2026 2:41am

Request Review

@changeset-bot
Copy link

changeset-bot bot commented Feb 23, 2026

🦋 Changeset detected

Latest commit: c5c8d30

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 25 packages
Name Type
@flint.fyi/spelling Patch
@flint.fyi/core Patch
@flint.fyi/cli Patch
@flint.fyi/astro Patch
@flint.fyi/browser Patch
@flint.fyi/json-language Patch
@flint.fyi/json Patch
@flint.fyi/jsx Patch
@flint.fyi/markdown-language Patch
@flint.fyi/md Patch
@flint.fyi/next Patch
@flint.fyi/node Patch
@flint.fyi/nuxt Patch
@flint.fyi/package-json Patch
@flint.fyi/performance Patch
@flint.fyi/plugin-flint Patch
@flint.fyi/react Patch
@flint.fyi/rule-tester Patch
@flint.fyi/solid Patch
@flint.fyi/text-language Patch
@flint.fyi/ts Patch
@flint.fyi/typescript-language Patch
@flint.fyi/volar-language Patch
@flint.fyi/yaml-language Patch
@flint.fyi/yaml Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

"@flint.fyi/cli": patch
---

Improve performance by a factor of 2.
Copy link
Member Author

Choose a reason for hiding this comment

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

It went from 2m to 1m on my machine, but it went from 1:25 to 1:22 in CI so... :)

Copy link
Member

@auvred auvred left a comment

Choose a reason for hiding this comment

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

Again, we will probabaly have to refactor this file from the ground up due to #1253 (comment); however I'm not against merging this!

flint.presets.stylistic,
node.presets.logicalStrict,
node.presets.stylisticStrict,
performance.presets.logical,
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this is unrelated to the PR?

Copy link
Member Author

@lishaduck lishaduck Feb 24, 2026

Choose a reason for hiding this comment

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

Oh, I was using the loopAwaits to track these down. Now that you say it though, I figure I can drop it from this PR b/c I didn't feel like fixing the loopFunctions violations.
Aside: Now that I say that, why isn't loopFunctions in the typescript plugin? That's a logic issue right?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Cross-linking for posterity, #2355 - because it's really annoying when you aren't optimizing for performance. Maybe we'd want to enable it for just core & cli, or something like that?

Base automatically changed from perf-presets to main February 27, 2026 04:08
Copy link
Collaborator

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Agreed, this is great - and can definitely land before the big project-aware refactor(s).

// Why read file many time when few do trick?
// Or, at least it should all be virtual...
// https://github.com/flint-fyi/flint/issues/73
// flint-disable-next-line performance/loopAwaits
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is what I mean by the annoyance of the loopAwaits rule. It's such a nitpicky thing!

Copy link
Member Author

Choose a reason for hiding this comment

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

Huh, I feel the opposite. To me it feels like it pointed out something we should be parallelizing to be good to our users, but I'm lazy and just skipped it (oh, we should implement baselines!.. someday).

Copy link
Collaborator

Choose a reason for hiding this comment

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

Hah, fair. I suppose this case is a good example of it being useful then 😄

if (!fileResults.reports.length) {
return;
}
const sourceFileText = await fs.readFile(filePath, "utf-8");
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just noting https://github.com/flint-fyi/flint/pull/2200/changes#diff-48fb99ed9bf971f8e02835a414bd4b3c49221bfea27c822b3bc6c23139a9e023: that'd be nice too, and maybe would eliminate part of the asynchronous-yness here?

Copy link
Member Author

@lishaduck lishaduck Mar 7, 2026

Choose a reason for hiding this comment

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

Yeah I'm cleaning up #2294 and I think that should help with some of this (not this one specifically I think but there were some relevant conflicts)

@JoshuaKGoldberg JoshuaKGoldberg added the 1 approval One team member approved; we're now waiting for a second approval or for 2 business days to pass. label Mar 1, 2026
@lishaduck lishaduck added the status: blocked Waiting for something else to be resolved 🙅 label Mar 7, 2026
@lishaduck
Copy link
Member Author

I'm going to block this on #2294 & #2321 b/c conflicts & I'm lazy & should be somewhat obsolete.

@lishaduck lishaduck removed the status: blocked Waiting for something else to be resolved 🙅 label Mar 13, 2026
Copy link
Collaborator

@JoshuaKGoldberg JoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Copy link
Member

@auvred auvred left a comment

Choose a reason for hiding this comment

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

👍

@auvred auvred added the ready to merge 2+ team members approved; we're now waiting on the author to file followups and self-merge. label Mar 15, 2026
@JoshuaKGoldberg JoshuaKGoldberg merged commit 1539f14 into main Mar 18, 2026
8 checks passed
@JoshuaKGoldberg JoshuaKGoldberg deleted the perf2 branch March 18, 2026 20:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1 approval One team member approved; we're now waiting for a second approval or for 2 business days to pass. ready to merge 2+ team members approved; we're now waiting on the author to file followups and self-merge.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants