Skip to content

feat: add performance-testing package - #3024

Open
JoshuaKGoldberg wants to merge 18 commits into
mainfrom
perf-comparisons
Open

feat: add performance-testing package#3024
JoshuaKGoldberg wants to merge 18 commits into
mainfrom
perf-comparisons

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Jun 24, 2026

Copy link
Copy Markdown
Collaborator

PR Checklist

Overview

Adds a new packages/performance-testing that includes a basic harness for generating different cases of (files to lint) x (rules to enable).

Measurements

Hyperfine 1.20.0 on an Apple Silicon Mac, Node 24.13.1, against ESLint 10.8.0 and typescript-eslint 8.66.0:

┌───────────────────────┬───────┬───────────────────────┬───────┐
│ eslint                │ files │ flint                 │ rules │
├───────────────────────┼───────┼───────────────────────┼───────┤
│ '649.1 ms ± 165.5 ms' │ 2     │ '843.0 ms ±  31.9 ms' │ 1     │
│ '807.2 ms ±  41.2 ms' │ 2     │ '855.9 ms ±  31.3 ms' │ 119   │
│ '802.3 ms ±  25.3 ms' │ 2     │ '826.9 ms ±  32.9 ms' │ 272   │
│ '954.6 ms ±  37.1 ms' │ 256   │ '1.030 s ±  0.043 s'  │ 1     │
│ '1.264 s ±  0.043 s'  │ 256   │ '1.182 s ±  0.029 s'  │ 119   │
│ '1.408 s ±  0.035 s'  │ 256   │ '1.292 s ±  0.032 s'  │ 272   │
│ '2.092 s ±  0.039 s'  │ 1024  │ '1.929 s ±  0.056 s'  │ 1     │
│ '2.678 s ±  0.063 s'  │ 1024  │ '2.414 s ±  0.048 s'  │ 119   │
│ '3.215 s ±  0.045 s'  │ 1024  │ '2.959 s ±  0.041 s'  │ 272   │
└───────────────────────┴───────┴───────────────────────┴───────┘

tl;dr: we're slower than ESLint for a small number of files and rules, then quickly get progressively faster at bigger scales of files and/or rules.

❤️‍🔥

@netlify

netlify Bot commented Jun 24, 2026

Copy link
Copy Markdown

Deploy Preview for flint-fyi ready!

Name Link
🔨 Latest commit 6aaf8f1
🔍 Latest deploy log https://app.netlify.com/projects/flint-fyi/deploys/6a8a4c02b0bef60008ba25ad
😎 Deploy Preview https://deploy-preview-3024--flint-fyi.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@changeset-bot

changeset-bot Bot commented Jun 24, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 6aaf8f1

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

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

@lishaduck

Copy link
Copy Markdown
Member
Are ya winning son? Nope.

@JoshuaKGoldberg

Copy link
Copy Markdown
Collaborator Author
┌───────┬───────┬───────────────────────┬──────────────────────┐
│ files │ rules │ eslint                │ flint                │
├───────┼───────┼───────────────────────┼──────────────────────┤
│ 2     │ 1     │ '771.6 ms ±  39.8 ms' │ '1.727 s ±  0.031 s' │
│ 2     │ 119   │ '852.0 ms ±   7.1 ms' │ '2.202 s ±  0.058 s' │
│ 2     │ 274   │ '876.8 ms ±   6.2 ms' │ '2.213 s ±  0.021 s' │
│ 256   │ 1     │ '1.095 s ±  0.013 s'  │ '1.966 s ±  0.037 s' │
│ 256   │ 119   │ '1.412 s ±  0.056 s'  │ '2.572 s ±  0.024 s' │
│ 256   │ 274   │ '1.551 s ±  0.009 s'  │ '2.775 s ±  0.010 s' │
└───────┴───────┴───────────────────────┴──────────────────────┘

Something is definitely wrong on the Flint side 😂, we're not ~1/2 the speed of ESLint. Nooope.

@lishaduck

lishaduck commented Jun 27, 2026

Copy link
Copy Markdown
Member

Something is definitely wrong on the Flint side 😂, we're not ~1/2 the speed of ESLint. Nooope.

You sure?

image

(closer look pins ESLint@1:19 and Flint@1:41 which feels reasonabler)

@JoshuaKGoldberg

Copy link
Copy Markdown
Collaborator Author

The perf comparisons should be running equivalent rules. I'm wondering if it's because Flint rules are so much more type-heavy, it's not a fair comparison?

@lishaduck

Copy link
Copy Markdown
Member

I'm wondering if it's because Flint rules are so much more type-heavy, it's not a fair comparison?

What if we just compare some not-type-aware lints Flint<->core ESLint and some type-aware lints typescript-eslint<->Flint so it's comparable? Flint'll still lose against raw ESLint probably, not hopefully not TSESLint.

@lishaduck

Copy link
Copy Markdown
Member

I'm hoping we can get a roughly unbiased comparison per-axis like vlt: https://github.com/vltpkg/benchmarks

JoshuaKGoldberg and others added 2 commits August 18, 2026 19:42
Resolves conflicts from the comparisons -> rule-data package rename.
Pairs each Flint rule with exactly one ESLint rule instead of whichever
mapping happened to sort last, so rule counts match on both sides. Points
both configs at src/**/*.ts with the same ignores, declares the plugins the
generated ESLint configs import, and runs Flint with --cache-ignore so
Hyperfine's repeat runs do not measure a warm cache against a cold one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@codecov

codecov Bot commented Aug 19, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.87179% with 4 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...sting/src/creators/files/createESLintConfigFile.ts 90.00% 1 Missing and 1 partial ⚠️
...es/performance-testing/src/creators/files/rules.ts 92.00% 1 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

Adds the return types and module ordering ESLint wants, marks the package
private so the package-json rules stop asking for exports, swaps two Array
constructors for Array.from, and disables performance/loopAwaits where the
sequencing is deliberate. Knip treats the package the way it already treats
e2e, since its dependencies are consumed by the ESLint configs it writes into
generated cases rather than by its own source.

Also records measurements in the README and enables the 1024-file cases.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@JoshuaKGoldberg JoshuaKGoldberg changed the title [WIP] feat: add performance-testing package feat: add performance-testing package Aug 19, 2026
@JoshuaKGoldberg

Copy link
Copy Markdown
Collaborator Author

aaaand we're faster again. The performance measurements were very flawed. Added to the PR description. Phew!

Comment thread packages/performance-testing/src/creators/files/createESLintConfigFile.ts Outdated
Comment thread packages/performance-testing/README.md Outdated
Comment thread rules.txt Outdated
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review August 19, 2026 14:18
@michaelfaith

Copy link
Copy Markdown
Member

✅ All modified and coverable lines are covered by tests.

We seem to have a gap in our test coverage measuring. There are no tests in this PR, yet codecov thinks everything's covered...

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This is really cool. Nice work. I'm particularly interested in building on this to include more plugins. For instance, i'd love to be able to use this to measure the perf impact of moving the markdown language to use the Sätteri parser.

Just a bit of feedback from my side. Also it'd be nice to add some unit test coverage.

Comment thread packages/performance-testing/README.md Outdated
Comment thread packages/performance-testing/README.md
Comment thread knip.ts Outdated
Comment thread packages/performance-testing/tsconfig.json Outdated
Comment thread packages/performance-testing/src/generate.ts Outdated
Comment thread packages/performance-testing/src/creators/range.ts
Comment thread packages/performance-testing/src/creators/createCaseFiles.ts Outdated
Comment thread packages/performance-testing/src/creators/createCaseFiles.ts Outdated

@michaelfaith michaelfaith left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks good! 👍 Just a bunch of string -> function describe titles (though these could be skipped and done when we formally adopt the vitest rule (I thought we already had...)), and the failing unit tests (due to cross platform path seps)

Comment thread knip.ts Outdated
Comment thread packages/performance-testing/src/writing/writeStructure.test.ts Outdated
Comment thread packages/performance-testing/src/writing/writeStructure.test.ts Outdated
Comment thread packages/performance-testing/src/writing/writeFile.test.ts Outdated
Comment thread packages/performance-testing/src/createTestCaseSlug.test.ts Outdated
Comment thread packages/performance-testing/src/creators/createCaseFiles.test.ts Outdated
Comment thread packages/performance-testing/src/creators/files/createPackageFile.test.ts Outdated
Comment thread packages/performance-testing/src/creators/files/createFlintConfigFile.test.ts Outdated
Comment thread packages/performance-testing/src/creators/files/createESLintConfigFile.test.ts Outdated
JoshuaKGoldberg and others added 2 commits August 22, 2026 16:55
Co-authored-by: michael faith <michaelfaith@users.noreply.github.com>
@JoshuaKGoldberg

Copy link
Copy Markdown
Collaborator Author

What if we just compare some not-type-aware lints Flint<->core ESLint and some type-aware lints typescript-eslint<->Flint so it's comparable? Flint'll still lose against raw ESLint probably, not hopefully not TSESLint.

I'm happy to report we're now winning overall! Whew. But it would be interesting to maybe add this as a separate issue, I think - in case we get curious?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

⚡️ Performance: Create a comparison generator setup

3 participants