zlib performance
Daniel Kozák via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Aug 7 05:37:46 PDT 2015
On Fri, 07 Aug 2015 12:29:26 +0000
"yawniek" <dlang at srtnwz.com> wrote:
> On Friday, 7 August 2015 at 11:45:00 UTC, Daniel Kozak wrote:
> > On Friday, 7 August 2015 at 09:12:32 UTC, yawniek wrote:
> >> [...]
> >
> > Can you try it without write operation (comment out all write)?
> > And than try it without uncompression?
> >
> >
> > // without compression:
> >
> > void main(string[] args)
> > {
> > auto f = File(args[1], "r");
> > foreach (buffer; f.byChunk(4096))
> > {
> > write(cast(char[])buffer);
> > }
> > }
>
> 0.03s user 0.09s system 11% cpu 1.046 total
>
So I/O seems to be OK
>
> > // without write:
> >
> > void main(string[] args)
> > {
> > auto f = File(args[1], "r");
> > auto uncompressor = new UnCompress(HeaderFormat.gzip);
> >
> > foreach (buffer; f.byChunk(4096))
> > {
> > auto uncompressed =
> > cast(char[])(uncompressor.uncompress(buffer));
> > }
> > uncompressor.flush;
> > }
>
> 2.82s user 0.05s system 99% cpu 2.873 total
>
So maybe it is a zlib problem on osx?
More information about the Digitalmars-d-learn
mailing list