-
-
Notifications
You must be signed in to change notification settings - Fork 146
Comparing changes
Open a pull request
base repository: belav/csharpier
base: main
head repository: deepskiesdev/csharpier
compare: main
- 15 commits
- 42 files changed
- 3 contributors
Commits on Dec 31, 2025
-
perf: use overload for
Any( SyntaxTriviaListto prevent allocations (……#1703) Semi reverts #1572 which overwrote #1485, I assume this was accidental. I noticed that you prefer explicit `Enumerable.Any` usage, should I convert this PR to use `ListExtensions.Any`? ## Benchmarks Saves around 15% of memory usage ### Before | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|--------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 128.0 ms | 2.44 ms | 3.43 ms | 3000.0000 | 1000.0000 | 34.57 MB | | Default_CodeFormatter_Complex | 260.3 ms | 5.11 ms | 7.17 ms | 5000.0000 | 2000.0000 | 53.05 MB | ### After | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|---------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 126.0 ms | 2.27 ms | 5.45 ms | 2000.0000 | 1000.0000 | 28.02 MB | | Default_CodeFormatter_Complex | 245.2 ms | 4.63 ms | 10.44 ms | 4000.0000 | 2000.0000 | 43.88 MB | Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f3a4a9a - Browse repository at this point
Copy the full SHA f3a4a9aView commit details -
perf: add
Doc.Nullcheck toArgumentavoidsConcatcreation (#1706) Add check for if `modifiers` are `Doc.Null` to avoid allocating a `Concat` and `Doc[]` ### Benchmarks (timing is inaccurate) #### Before | Method | Mean | Error | StdDev | Median | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|--------:|---------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 131.9 ms | 3.30 ms | 8.86 ms | 128.0 ms | 3000.0000 | 1000.0000 | 34.57 MB | | Default_CodeFormatter_Complex | 261.3 ms | 5.16 ms | 4.03 ms | 261.3 ms | 5000.0000 | 2000.0000 | 53.03 MB | #### After | Method | Mean | Error | StdDev | Median | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|---------:|---------:|---------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 189.5 ms | 10.25 ms | 28.05 ms | 195.6 ms | 3000.0000 | 1000.0000 | 34.31 MB | | Default_CodeFormatter_Complex | 264.2 ms | 5.27 ms | 13.97 ms | 260.0 ms | 5000.0000 | 2000.0000 | 52.31 MB | Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 87b7152 - Browse repository at this point
Copy the full SHA 87b7152View commit details -
perf: use
Stack.Peekto reducePopandPushchurn (#1708)Not sure if more changes might help here, perhaps calling `docsStack.Push(TraverseDocOnExitStackMarker);` later and adding an `else` clause might help, that or using a goto. Might be easier to measure an improvement once other changes were made. Did wonder if `ValueListBuilder` will help due to faster `Push` and `Pop`. Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for cd499af - Browse repository at this point
Copy the full SHA cd499afView commit details -
perf: set capacity of
ListinMembersForcedLine(#1709)Most `result` Lists are always just under `3 * members.Count`, small change but simple 🤷 ### Benchmarks (timing is inaccurate should be the same) #### Before | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|--------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 133.0 ms | 2.56 ms | 2.84 ms | 3000.0000 | 1000.0000 | 34.58 MB | | Default_CodeFormatter_Complex | 271.5 ms | 5.40 ms | 7.92 ms | 5000.0000 | 2000.0000 | 52.95 MB | #### After | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|--------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 132.4 ms | 2.64 ms | 3.87 ms | 3000.0000 | 1000.0000 | 34.56 MB | | Default_CodeFormatter_Complex | 268.2 ms | 4.92 ms | 4.60 ms | 5000.0000 | 2000.0000 | 52.78 MB | Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 192ecd1 - Browse repository at this point
Copy the full SHA 192ecd1View commit details -
perf: optimise
SyntaxNodeComparer(#1730)It appears that `SyntaxNodeComparer` is run after a file is formated, optimisation here may be impactful - Prevent null `Func<T, T, Result>` allocations (still seeing some in the profiler, no idea how to sotp this) - Prevent boxing of `SyntaxTokenList`, `SyntaxNodeOrTokenList` - Use `OrderBy.ToArray` instead of `OrderBy.ToList` - Create `AllSeparatorsButLast` to prevent boxing `SeparatedSyntaxList<SyntaxNode>` and `IEnumerable` creation I have some other idea, but I'm focusing on the unhappy path right now. ### Benchmark (comparing `complexCode`) #### Before | Method | Mean | Error | StdDev | Gen0 | Gen1 | Gen2 | Allocated | |--------------------------- |---------:|--------:|--------:|----------:|----------:|----------:|----------:| | Default_SyntaxNodeComparer | 229.1 ms | 4.55 ms | 7.60 ms | 5000.0000 | 3000.0000 | 1000.0000 | 40.53 MB | #### After | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |--------------------------- |---------:|--------:|--------:|----------:|----------:|----------:| | Default_SyntaxNodeComparer | 187.4 ms | 3.51 ms | 7.64 ms | 3000.0000 | 1000.0000 | 31.39 MB | Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for 350c7fe - Browse repository at this point
Copy the full SHA 350c7feView commit details -
perf: fast comparison using
FullSpanand source code (#1737)- Compare the old and formatted code before using `SyntaxNodeComparer` (ie new version of csharpier, no changes but hash is cache is invalidated) - Skip comparison if two `TypeDeclaration` aka (classes, struct, interfaces etc) or `MethodDeclaration` are identical - This could be done for all `SyntaxNodes` but may slow things down if most nodes have changed The CLI spends up to 30% of the time doing comparisons, with this, we can skip cases with identical source code, and only compare types/methods that have changed. The performance degradation for lots of changes (i.e. first time a project is formatted) shouldn't be that great as `CompareFullSpan` is basically a fast `SequenceEqual` and only used for type declarations and methods. Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for c087368 - Browse repository at this point
Copy the full SHA c087368View commit details -
perf: cache
IgnoreWithBasePath(#1758)Repeatedly compiling regex for ignore files is a significant amount of runtime, caches the `IgnoreWithBasePath` to prevent this. See also #1776 ### Before | Method | Mean | Error | StdDev | Gen0 | Gen1 | Allocated | |---------- |---------:|---------:|---------:|----------:|----------:|----------:| | FormatCli | 955.0 ms | 17.65 ms | 29.98 ms | 9000.0000 | 1000.0000 | 81.5 MB | ### After | Method | Mean | Error | StdDev | Gen0 | Allocated | |---------- |---------:|---------:|---------:|----------:|----------:| | FormatCli | 683.5 ms | 13.61 ms | 30.17 ms | 7000.0000 | 69.33 MB | Co-authored-by: Bela VanderVoort <[email protected]>
Configuration menu - View commit details
-
Copy full SHA for f9a3b14 - Browse repository at this point
Copy the full SHA f9a3b14View commit details -
Adding the xml whitespace options (#1793)
This is just adding the options that will eventually be used by the new xml whitespace handling code.
Configuration menu - View commit details
-
Copy full SHA for ff79092 - Browse repository at this point
Copy the full SHA ff79092View commit details
Commits on Jan 1, 2026
-
Configuration menu - View commit details
-
Copy full SHA for 838b331 - Browse repository at this point
Copy the full SHA 838b331View commit details
Commits on Jan 19, 2026
-
Update bug report template with playground link
Added a reminder for users to recreate formatting issues on the playground.
Configuration menu - View commit details
-
Copy full SHA for cbe200c - Browse repository at this point
Copy the full SHA cbe200cView commit details -
Add axaml to VS. Bump up version number on all plugins to try to help…
… with people not realizing they are versioned differently.
Configuration menu - View commit details
-
Copy full SHA for 7d939ba - Browse repository at this point
Copy the full SHA 7d939baView commit details -
Configuration menu - View commit details
-
Copy full SHA for e1ff536 - Browse repository at this point
Copy the full SHA e1ff536View commit details -
Improve version check formatting in bug.yml
Updated formatting for version checks in bug report template.
Configuration menu - View commit details
-
Copy full SHA for 9f870a7 - Browse repository at this point
Copy the full SHA 9f870a7View commit details -
Revise bug report template for clarity and versioning
Updated the bug report template to include checkboxes for user confirmation and added specific version numbers for CSharpier.
Configuration menu - View commit details
-
Copy full SHA for ff9ad30 - Browse repository at this point
Copy the full SHA ff9ad30View commit details -
Configuration menu - View commit details
-
Copy full SHA for aba100e - Browse repository at this point
Copy the full SHA aba100eView commit details
This comparison is taking too long to generate.
Unfortunately it looks like we can’t render this comparison for you right now. It might be too big, or there might be something weird with your repository.
You can try running this command locally to see the comparison on your machine:
git diff main...main