B+Tree indices: ongoing progress

John Arbash Meinel john at arbash-meinel.com
Wed Jul 2 03:19:09 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Jonathan Lange wrote:
| On Wed, Jul 2, 2008 at 11:58 AM, Robert Collins
| <robertc at robertcollins.net> wrote:
|> Also, regarding zlib object copying:
|>>>> import zlib
|>>>> c = zlib.compressobj()
|>>>> c.copy()
|> <zlib.Compress object at 0x7f21b6ee2dd8>
|>
|> so my python has it - if yours doesn't, then that backs up my theory
|> that it would be a hassle to use it :). Though we could try and
|> fallback...
|>
|
| I'm missing some context here, but I'll barge in anyway.
|
| As a data point, the object returned by zlib.compressobj() doesn't
| have a copy attribute in Python 2.4. In Python 2.5, it works as you
| say.
|
| jml
|

Not entirely true:

Python 2.4.4 (#71, Oct 18 2006, 08:34:43) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
|>> import zlib
|>> c = zlib.compressobj()
|>> c.copy()
Traceback (most recent call last):
~  File "<stdin>", line 1, in ?
AttributeError: copy


Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
|>> import zlib
|>> c = zlib.compressobj()
|>> c.copy()
Traceback (most recent call last):
~  File "<stdin>", line 1, in <module>
AttributeError: copy

Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
|>> import zlib
|>> c = zlib.compressobj()
|>> c.copy()
<zlib.Compress object at 0x7ff74de0>



So it seems that cygwin python has object.copy() but win32 python does
not (for 2.4 *and* for 2.5).

I know of 2 decent tricks for speeding things up, if we feel it is
important.

I knew it was slower (though I only saw 6s difference on bzr.dev here).
I can shave a bit of that off, and I'll do a "getattr(c, 'copy')" patch
to see how that works for you.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkhq5Z0ACgkQJdeBCYSNAAMqkACgv8/tiM9MaUY19Or7z7rjBfOJ
UokAn1dplMPyja8RlsRG927oWabk8ZHA
=/WsK
-----END PGP SIGNATURE-----



More information about the bazaar mailing list