Rev 2514: (python-only) Shave a bit of time off by calling binascii.b2a_base64 in http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex
John Arbash Meinel
john at arbash-meinel.com
Sat May 5 14:25:31 BST 2007
At http://bzr.arbash-meinel.com/branches/bzr/0.17-dev/dirstate_pyrex
------------------------------------------------------------
revno: 2514
revision-id: john at arbash-meinel.com-20070505132458-0fe0g2jfdoyg95mn
parent: john at arbash-meinel.com-20070505050202-hmi7l9smckjrf2pa
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: dirstate_pyrex
timestamp: Sat 2007-05-05 08:24:58 -0500
message:
(python-only) Shave a bit of time off by calling binascii.b2a_base64
I should have looked closer, base64.encodestring() is a Legacy api, which
just wraps binascii.b2a_base64.
On 21k pack_stat calls, it drops us from around 784ms to 281ms
modified:
bzrlib/dirstate.py dirstate.py-20060728012006-d6mvoihjb3je9peu-1
-------------- next part --------------
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py 2007-05-04 18:11:28 +0000
+++ b/bzrlib/dirstate.py 2007-05-05 13:24:58 +0000
@@ -200,7 +200,7 @@
"""
-import base64
+import binascii
import bisect
import errno
import os
@@ -2290,7 +2290,7 @@
-def pack_stat(st, _encode=base64.encodestring, _pack=struct.pack):
+def pack_stat(st, _encode=binascii.b2a_base64, _pack=struct.pack):
"""Convert stat values into a packed representation."""
# jam 20060614 it isn't really worth removing more entries if we
# are going to leave it in packed form.
More information about the bazaar-commits
mailing list