Speed of csvReader

Jesse Phillips via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Jan 21 13:48:11 PST 2016


On Thursday, 21 January 2016 at 21:24:49 UTC, H. S. Teoh wrote:
> Of course, running without GC collection is not a fair 
> comparison with std.csv, so I added an option to my benchmark 
> program to disable the GC for std.csv as well.  While the 
> result was slightly faster, it was still much slower than my 
> fastcsv code. (Though to be fair, std.csv does perform 
> validation checks and so forth that fastcsv doesn't even try 
> to.)

As mentioned validation can be turned off

auto data = std.csv.csvReader!(string, 
Malformed.ignore)(input).array;

I forgot to mention that one of the requirements for std.csv was 
that it worked on the base range type, input range. Not that 
slicing wouldn't be a valid addition.

I was also going to do the same thing with my sliced CSV, no 
fixing of the escaped quote. That would have just been a helper 
function the user could map over the results.


More information about the Digitalmars-d-learn mailing list