Using iopipe to stream a gzipped file

Andrew aabrown24 at hotmail.com
Thu Jan 4 17:02:36 UTC 2018


On Thursday, 4 January 2018 at 15:48:21 UTC, Steven Schveighoffer 
wrote:
>
> It's now been updated, see version 0.0.3.
>
> Note, the performance isn't something I focused on. I'll note 
> that gzcat | wc -l is 2x faster than your simple example on 
> that file.
>
> I can think of a couple reasons for this:
>
> 1. gzcat may use mmap to increase read speed
> 2. gzcat may read larger chunks at once (this can be tuned 
> using iopipe as well, just set the optimizedReadSize).
> 3. gzcat file.gz | iopipe_byline -nooutput is about 20% faster 
> than using wc -l, so it's definitely not the line parsing.
>
> Let me know if this works correctly for your other test cases! 
> If not, file an issue: 
> https://github.com/schveiguy/iopipe/issues
>
> -Steve

That works perfectly, thank you very much!


More information about the Digitalmars-d-learn mailing list