perf: add ValueListBuilder to InvocationExpression#1542
Draft
TimothyMakkison wants to merge 2 commits intobelav:mainfrom
Draft
perf: add ValueListBuilder to InvocationExpression#1542TimothyMakkison wants to merge 2 commits intobelav:mainfrom
ValueListBuilder to InvocationExpression#1542TimothyMakkison wants to merge 2 commits intobelav:mainfrom
Conversation
217f9e9 to
8a5b260
Compare
eeaf247 to
9e9ad83
Compare
belav
pushed a commit
that referenced
this pull request
Aug 3, 2025
- Replaces `StringBuilder` with `ValueListBuilder<char>` - Added some extension methods to make this easier - Uses `SkipLocalsInit` to avoid the cost to zero `stackalloc char[]` #### Benchmarks I have no idea why, all the new changes I make are slower in the benchmarks, even when they should be a straight upgrade 🤔 I'm running into this issue a lot with #1542 ### Before | Method | Mean | Error | StdDev | Median | Gen0 | Gen1 | Allocated | |------------------------------ |---------:|--------:|---------:|---------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 133.7 ms | 2.65 ms | 3.54 ms | 133.7 ms | 2000.0000 | 1000.0000 | 31.07 MB | | Default_CodeFormatter_Complex | 284.9 ms | 5.60 ms | 13.95 ms | 279.1 ms | 5000.0000 | 2000.0000 | 54.59 MB | ### After | Method | Mean | Error | StdDev | Median | Gen0 | Gen1 | Gen2 | Allocated | |------------------------------ |---------:|--------:|---------:|---------:|----------:|----------:|----------:|----------:| | Default_CodeFormatter_Tests | 136.2 ms | 2.69 ms | 5.74 ms | 134.5 ms | 2000.0000 | 1000.0000 | - | 30.71 MB | | Default_CodeFormatter_Complex | 285.6 ms | 5.71 ms | 14.93 ms | 278.1 ms | 6000.0000 | 3000.0000 | 1000.0000 | 53.45 MB |
8e9e333 to
3c541cc
Compare
3c541cc to
e7d7b4f
Compare
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.
PrintedNodeto arecord structList<PrintedNode>toValueListBuilder<PrintedNode>Saves 5 MB and 1.25 MB on the complex and test benchmarks