Closed CarlVerret closed 1 year ago
That's quite impressive. I'm not sure I want to take on a dependency though. This would be a great thing to add to the contrib library. Someone could use a FastDoubleConverter
if they wanted more speed. The contrib lib doesn't exist yet because no one has wanted add features they want in there. There is a repo though. https://github.com/CsvHelperContrib/CsvHelperContrib
Out of curiosity, why not submit a pull request to .NET and speed up the native implementation?
Thanks. It is already filed : https://github.com/dotnet/runtime/issues/48646
I'll consider adding a converter for this in the contrib library. I don't have time at the moment, but I'll keep this open. I'm also watching the .NET framework issue you referenced.
Let me know if I can be of any help !
@CarlVerret It looks like this is merged in the runtime and thus can be closed as resolved for .net 7 https://github.com/dotnet/runtime/pull/62301
Awesome!
Hi Josh!
As CSVHelper is one of the fastest library available, we thought that you'd be interested to get even faster!
We recently published csFastFloat, a fast and accurate float parser. It is almost 7 times faster than the standard library in some cases while providing exact results. It is a C# port of Daniel Lemire's fast_float originaly written in C++.
Our benchmark demonstrates that replacing double.Parse with FastDoubleParser results in a real peformance improvement. Results are shown in million of float parsed per second.
We parsed both single and multiple columns files using CSVHelper (with custom DefaultTypeConverter) :
csFastFloat is available as a NuGet package . Benchmark repo can be found here
I'll be pleased to submit a Pull Request.