0.6 release plan

John A Meinel john at arbash-meinel.com
Thu Oct 27 04:25:14 BST 2005


Martin Pool wrote:
> On 25/10/05, John Arbash Meinel <john at arbash-meinel.com> wrote:
> 

...

>> Though in my testing, uncompressing an entire inventory.weave.gz only
>> takes 0.04s. Which is quite a bit less time than it takes to extract one
>> of it's entries.
> 
> OK. that's good to know.  I previously thought the Python gzip
> interface was very slow, but I think this is because the hotspot
> profiler tends to misattribute time used in generators.

Well, I have to say that you are correct that python's gzip isn't as
fast as the native gzip. Specifically, I tested this:

import time, os
import gzip
def t():
  tstart = time.time()
  f = gzip.open('inventory.weave.gz')
  f.read()
  f.close()
  tend = time.time()
  print tend-tstart

t() # 0.15

So the gzip.open() and reading everything takes 0.15s (this is my slow
machine)

On the other hand, we have this:
$ time zcat inventory.weave.gz > /dev/null

real    0m0.101s
user    0m0.088s
sys     0m0.028s

So the python's gzip is 50% slower than the compiled version. And if I
try to read 1024*1024 chunks at a time, it slows down to 0.17s.


On my fast machine (running windows), this changes a little bit:
$ time zcat inventory.weave.gz > /dev/null

real    0m0.069s
user    0m0.077s
sys     0m0.030s

t() # 0.036

Which actually means that zcat is slower than python. On the other side,
though "time : | cat" takes 0.07s, so probably the difference is just
the windows process spawn time. ("time /usr/bin/echo" takes 0.04s)

John
=:->


> 
> --
> Martin
> 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20051026/d8685f44/attachment.pgp 


More information about the bazaar mailing list