Speed of csvReader

data pulverizer via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 22 13:41:46 PST 2016


On Friday, 22 January 2016 at 02:16:14 UTC, H. S. Teoh wrote:
> On Thu, Jan 21, 2016 at 04:50:12PM -0800, H. S. Teoh via 
> Digitalmars-d-learn wrote:
>> [...]
>> > > 	https://github.com/quickfur/fastcsv
> [...]
>
> Fixed some boundary condition crashes and reverted doubled 
> quote handling in unquoted fields (since those are illegal 
> according to RFC 4810).  Performance is back in the ~1200 msec 
> range.
>
>
> T

Hi H. S. Teoh,  I have used you fastcsv on my file:

import std.file;
import fastcsv;
import std.stdio;
import std.datetime;

void main(){
   StopWatch sw;
   sw.start();
   auto input = cast(string) read("Acquisition_2009Q2.txt");
   auto mydata = fastcsv.csvToArray!('|')(input);
   sw.stop();
   double time = sw.peek().msecs;
   writeln("Time (s): ", time/1000);
}

$ dmd file_read_5.d fastcsv.d
$ ./file_read_5
Time (s): 0.679

Fastest so far, very nice.


More information about the Digitalmars-d-learn mailing list