Skip to content

Add CodSpeed performance benchmarks for linter#668

Closed
codspeed-hq[bot] wants to merge 2 commits intomainfrom
codspeed-wizard-1776073427761
Closed

Add CodSpeed performance benchmarks for linter#668
codspeed-hq[bot] wants to merge 2 commits intomainfrom
codspeed-wizard-1776073427761

Conversation

@codspeed-hq
Copy link
Copy Markdown

@codspeed-hq codspeed-hq Bot commented Apr 13, 2026

Summary

This PR sets up continuous performance tracking for Rslint using CodSpeed.

Changes

  • Go benchmarks (internal/linter/linter_bench_test.go): Five benchmarks covering the linter's core execution path:

    • BenchmarkLintSingleRule_NoVar -- lints a realistic TypeScript file with the no-var rule
    • BenchmarkLintSingleRule_Eqeqeq -- lints with the strict equality rule
    • BenchmarkLintSingleRule_NoConsole -- lints with the no-console rule
    • BenchmarkLintMultipleRules -- lints with all three rules combined
    • BenchmarkLintLargeFile -- lints a 50-function TypeScript file with multiple rules to measure scaling behavior
  • GitHub Actions workflow (.github/workflows/codspeed.yml): Runs benchmarks on codspeed-macro runners using walltime mode with OIDC authentication. Triggers on pushes to main, pull requests, and manual dispatch (for backtest analysis).

  • CodSpeed badge added to README.md.

How it works

The benchmarks use the same program creation approach as the existing linter tests (createTestProgramWithFiles pattern). Each benchmark creates a TypeScript program from source code, then measures the time spent in RunLinterInProgram with configured rules. Setup time (program creation, temp directory) is excluded from measurements via b.ResetTimer().

Next steps

  • Visit the CodSpeed dashboard after the first run to view results
  • Consider adding benchmarks for type-aware rules and config parsing as the project evolves
  • Performance checks on PRs will automatically flag regressions once baseline data is established

@codspeed-hq codspeed-hq Bot force-pushed the codspeed-wizard-1776073427761 branch from 8f674a2 to 6c1acee Compare April 13, 2026 10:00
@codspeed-hq
Copy link
Copy Markdown
Author

codspeed-hq Bot commented Apr 13, 2026

Congrats! CodSpeed is installed 🎉

🆕 5 new benchmarks were detected.

You will start to see performance impacts in the reports once the benchmarks are run from your default branch.

Detected benchmarks


Open in CodSpeed

@codspeed-hq codspeed-hq Bot marked this pull request as ready for review April 13, 2026 10:06
@fansenze fansenze closed this Apr 23, 2026
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.

1 participant