Skip to content

feat: refactored benchmarks and added CliBenchmarks - #1896

Merged
belav merged 2 commits into
belav:mainfrom
TimothyMakkison:cli_bench
Aug 9, 2026
Merged

feat: refactored benchmarks and added CliBenchmarks#1896
belav merged 2 commits into
belav:mainfrom
TimothyMakkison:cli_bench

Conversation

@TimothyMakkison

@TimothyMakkison TimothyMakkison commented Aug 6, 2026

Copy link
Copy Markdown
Contributor
  • Added CliBenchmarks containing benchmarks for formatting a directory and checking a list of files.
    • Uses the CSharpier project to format and check. This is more of a benchmark to measure the time to get the files as opposed to a formatting benchmark as the files will become cached.
    • As Soda found in Improve performance of CLI when passing in files/folders #1893, CSharpier is very bad at handing multiple files, each iteration of CliBench took 50 seconds for me 😑
  • Benchmarks is getting cluttered so I split it up into CSharpBenchmarks and XmlBenchmarks

Relevant to #1893

@TimothyMakkison

TimothyMakkison commented Aug 8, 2026

Copy link
Copy Markdown
Contributor Author

Should work, but I'm a little confused.

When I run dotnet csharpier format . at the root of my csharpier repo it takes 3 seconds, even when the files haven't changed and thus should be cached
Formatted 447 files in 3881ms.

FormatCli should be identical and yet it runs faster than in terminal
Formatted 447 files in 872ms.

I assume this discrepancy is because the method is allowed to warmup beforehand 🤔

@TimothyMakkison

Copy link
Copy Markdown
Contributor Author

Renamed the benchmarks and added Format and FormatNoCache

@belav
belav enabled auto-merge (squash) August 9, 2026 21:10
@belav
belav merged commit 18bd01b into belav:main Aug 9, 2026
7 checks passed
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.

2 participants