CSharpPerformanceBoosters icon indicating copy to clipboard operation
CSharpPerformanceBoosters copied to clipboard

Highly Performant C# code with benchmark results

Results 4 CSharpPerformanceBoosters issues
Sort by recently updated
recently updated
newest added

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` that can be allocated on stack....

By splitting the pipe into the writing end and reading end it seems to be able to slightly boost performance. On my system it benchmarks as roughly ~10% faster to...

By specifying the invariant culture the tests are able to parse the DateTimes correctly and run to completion, irregardless of how the local systems Culture is configured.

The test data assumes a culture that can parse DateTimes in the format '1/19/7051'. This is not universally the case. If you are located somewhere that uses another format for...