CSharpPerformanceBoosters
CSharpPerformanceBoosters copied to clipboard
Extra string allocation can be removed
at line if (DateTime.TryParse(Encoding.UTF8.GetString(line[..comaAt]), out var doj))
Encoding.UTF8.GetString
allocates string on heap which is unnecessary, can be replaced by Encoding.UTF8.GetChars
writing chars into Span<char>
that can be allocated on stack. Saves additional 4 MB allocations in the benchmark.