csharpier
csharpier copied to clipboard
perf: add new `Concat` types for children lengths
Taking inspiration from Roslyn I added several implementation of Concat one for each number of children and WithManyChildren.
This lets us use Concat(params ReadOnlySpan<Doc> values, this way we can use WithTwoChildren or WithThreeChildren when there is a small numbers of values, only allocating to an array when there is a large number of Doc types.
This currently saves 2 MB (6% memory usage) however I expect this number to go up when combined with #1502