Rev 4427: Document some perf issues with using known_parent_gdfos, but leave it as a dict. in http://bazaar.launchpad.net/~jameinel/bzr/jam-gdfo-heads
John Arbash Meinel
john at arbash-meinel.com
Fri Jun 19 18:20:36 BST 2009
At http://bazaar.launchpad.net/~jameinel/bzr/jam-gdfo-heads
------------------------------------------------------------
revno: 4427
revision-id: john at arbash-meinel.com-20090619172010-1g5aj28byaxko408
parent: john at arbash-meinel.com-20090619170818-9yi5nqmgo0x09983
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: jam-gdfo-heads
timestamp: Fri 2009-06-19 12:20:10 -0500
message:
Document some perf issues with using known_parent_gdfos, but leave it as a dict.
-------------- next part --------------
=== modified file 'bzrlib/_known_graph_pyx.pyx'
--- a/bzrlib/_known_graph_pyx.pyx 2009-06-19 17:08:18 +0000
+++ b/bzrlib/_known_graph_pyx.pyx 2009-06-19 17:20:10 +0000
@@ -220,6 +220,9 @@
cdef Py_ssize_t pending_size
pending = []
+ # Setting this as an attribute of _KnownGraphNode drops 774ms => 621ms,
+ # but adds a field that we won't use again. It avoids a dict lookup,
+ # and using PyInt rather than plain 'long'.
known_parent_gdfos = {}
for node in self._tails:
@@ -229,6 +232,7 @@
pending_size = PyList_GET_SIZE(pending)
while pending_size > 0:
# Avoid pop followed by push, instead, peek, and replace
+ # timing shows this is 930ms => 770ms for OOo
node = _get_list_node(pending, pending_size - 1)
replace = 1
for child_pos from 0 <= child_pos < PyList_GET_SIZE(node.children):
More information about the bazaar-commits
mailing list