On Mon, May 7, 2012 at 8:17 PM, Nigel Tao <
nige...@golang.org> wrote:
>
> On 7 May 2012 21:53, Leo Jay <
python...@gmail.com> wrote:
> > The result is very strange to me:
> > $ time go run zlibtest.go
>
> This measures the time to compile, link and run that program. Another
> data point would be to measure just the portion spent running:
> $ go build zlibtest.go && time ./zlibtest
>
I tried, but the result is almost the same. And I don't think go needs
a lot of time to compile such a simple program.
> Also, are you on the release (also known as go1.0.1) or on tip? ZLIB
> wraps flate, and I submitted an optimization [0] to flate just a week
> or so ago, on tip, that speeds up some decompression microbenchmarks
> by up to 2x, depending on the workload.
>
I tried 1.0, 1.0.1 and the tip version, the result is almost the same
for all of them.
And I also tried to set the for loop max value to 100000 (10 times to
the previous version),
The go version needs about 40 seconds, and python needs about 7 seconds.
I used some normal text files.
You may try to download this script and compress it with zlib, and use
this as the zlibtest.dat:
http://python-distribute.org/distribute_setup.py