Speeding up text file parser (BLAST tabular format)

Kagamin via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Sep 15 02:08:58 PDT 2015


On Tuesday, 15 September 2015 at 08:53:37 UTC, Fredrik Boulund 
wrote:
>> my favourite for streaming a file:
>> enum chunkSize = 4096;
>> File(fileName).byChunk(chunkSize).map!"cast(char[])a".joiner()
>
> Is this an efficient way of reading this type of file? What 
> should one keep in mind when choosing chunkSize?

It provides you only one char at a time instead of a whole line. 
It will be quite constraining for your code if not mind-bending.


More information about the Digitalmars-d-learn mailing list