Slow performance for --include with single file
See original GitHub issueHi, I’m just experimenting with dotnet-format for the first time. I noticed that running it on a single file has more overhead than I would expect.
# Run on 223 files
$ git ls-files | grep .cs$ > all_cs.txt
$ dotnet format --folder --include @all_cs.txt
Formatting code files in workspace '/xyz/ml-agents'.
...
Format complete in 2297ms.
# Run on 1 file
$ dotnet format --folder --include com.unity.ml-agents/Tests/Editor/MultinomialTest.cs
Formatting code files in workspace '/xyz/ml-agents'.
Format complete in 1325ms.
Is that expected? It’s not horrible, but it would be mildly annoying to run incrementally on git commits.
Platform/version information: MacOS 10.14.6
$ dotnet --version
3.1.401
$ dotnet-format --version
4.1.131201+82a5527cd93d66bffc885c0bb901499f5981db35
Issue Analytics
- State:
- Created 3 years ago
- Reactions:25
- Comments:27 (12 by maintainers)
Top Results From Across the Web
Entity-framework code is slow when using Include() many ...
If at least one entity does not have a relationship to some of other entities, then EF will not able to construct one...
Read more >does having code spread in multiple files decrease ...
In large projects, using a single file to store source code greatly reduces code quality and development efficiency. It brings negligible ...
Read more >System stops responding, slow file server performance, or ...
System stops responding, slow file server performance, or delays occur when you work with files that are located on a file server.
Read more >Huge drop in read performance between single file vs. ...
When transferring a large single file from storage server (Z: ) to editing (D: or C: ), I have sustained transfer speed of...
Read more >How many files can you put in a Windows folder without ...
I'm guessing there's no hard limit, but I know that performance degrades when you put too many files into a single Windows folder....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Same here. This is the single biggest problem
dotnet format
suffers from. It’s simply unacceptable that it takes multiple seconds to format a single file. Formatters built into Visual Studio or the OmniSharp extension for VS Code typically take under 500 milliseconds to format a single small-to-medium-sized file.Similar tools in other ecosystems such as
go fmt
orprettier
are much, much more performant as well. This issue needs to be given higher priority, I’d argue.@jmarolf @JoeRobich Sorry to tag you guys, but just wanted to get some updates on this. Have you guys managed to identify the root cause of this yet?
Is this issue actively working on? I am under the impression that dotnet format is somewhat slow which make make it annoying to run locally before committing.