perf: use overload for Any( SyntaxTriviaList to prevent allocations - #1703
Merged
Merged
Conversation
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
3 times, most recently
from
October 13, 2025 11:31
f1f236e to
da71f31
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
from
October 21, 2025 00:01
da71f31 to
153de41
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
4 times, most recently
from
November 2, 2025 19:35
83a2e47 to
286d295
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
3 times, most recently
from
November 14, 2025 22:58
be8c694 to
ec65cc7
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
from
November 22, 2025 15:46
ec65cc7 to
3acbbbb
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
from
December 5, 2025 20:28
3acbbbb to
1ebd674
Compare
TimothyMakkison
force-pushed
the
trivia_list_enumerator
branch
from
December 12, 2025 12:48
1ebd674 to
f57a3cd
Compare
belav
approved these changes
Dec 25, 2025
belav
left a comment
Owner
There was a problem hiding this comment.
I'm not really sure how these ended up using Enumerable.Any as it is not something I prefer. I much prefer the extension methods especially if using them is more efficient!
belav
added a commit
that referenced
this pull request
Dec 31, 2025
…#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 <twobitbela@gmail.com>
belav
added a commit
that referenced
this pull request
Feb 20, 2026
…#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 <twobitbela@gmail.com>
belav
added a commit
that referenced
this pull request
Mar 12, 2026
…#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 <twobitbela@gmail.com>
belav
added a commit
that referenced
this pull request
Apr 4, 2026
…#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 <twobitbela@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Semi reverts #1572 which overwrote #1485, I assume this was accidental. I noticed that you prefer explicit
Enumerable.Anyusage, should I convert this PR to useListExtensions.Any?Benchmarks
Saves around 15% of memory usage
Before
After