Closed sonnemaf closed 8 months ago
Oh, do you realize that if everything other than ProcessChunk
was exactly zero then the difference would be less than the noise on my very stable dedicated benchmarking machine!?
Are you saying that the Console.Write() is free? Can't imagine that.
It takes ~ 15-20 msec
. Well, my benchmark resolution is better than that, I will admit that. Will see if the impact is visible.
Actually I already use that locally, not committed yet. I thought you've implemented Utf8 formatting to a Span<byte>
.
I actually like this because it's the right approach. Even if there is not difference in performance. Thank you!
Hi,
I think you can win something by implementing
ISpanFormattable
onSummary
. This will make the string interpolation inConsole.Write($"{pair.Name}={pair.Value}")
run faster. You avoid the ToString() method.You can try this using this code. It was faster on my (slow) computer.
If it works you can even gain more performance by reimplementing the TryFormat method without the use of the TryWrite extensionmethod. It quite a lot of work but might work.
Regards,
Fons