Reading from stdin significantly slower than reading file directly?

Jon Degenhardt jond at noreply.com
Thu Aug 13 17:05:53 UTC 2020


On Thursday, 13 August 2020 at 14:41:02 UTC, Steven Schveighoffer 
wrote:
> But for sure, reading from stdin doesn't do anything different 
> than reading from a file if you are using the File struct.
>
> A more appropriate test might be using the shell to feed the 
> file into the D program:
>
> dprogram < FILE
>
> Which means the same code runs for both tests.

Indeed, using the 'prog < file' approach rather than 'cat file | 
prog' indeed removes any distinction for 'tsv-select'. 
'tsv-select' uses File.rawRead rather than File.byLine.



More information about the Digitalmars-d-learn mailing list