~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/_known_graph_pyx.pyx

  • Committer: John Arbash Meinel
  • Date: 2009-06-19 17:20:10 UTC
  • mto: This revision was merged to the branch mainline in revision 4466.
  • Revision ID: john@arbash-meinel.com-20090619172010-1g5aj28byaxko408
Document some perf issues with using known_parent_gdfos, but leave it as a dict.

Show diffs side-by-side

added added

removed removed

Lines of Context:
220
220
        cdef Py_ssize_t pending_size
221
221
 
222
222
        pending = []
 
223
        # Setting this as an attribute of _KnownGraphNode drops 774ms => 621ms,
 
224
        # but adds a field that we won't use again. It avoids a dict lookup,
 
225
        # and using PyInt rather than plain 'long'.
223
226
        known_parent_gdfos = {}
224
227
 
225
228
        for node in self._tails:
229
232
        pending_size = PyList_GET_SIZE(pending)
230
233
        while pending_size > 0:
231
234
            # Avoid pop followed by push, instead, peek, and replace
 
235
            # timing shows this is 930ms => 770ms for OOo
232
236
            node = _get_list_node(pending, pending_size - 1)
233
237
            replace = 1
234
238
            for child_pos from 0 <= child_pos < PyList_GET_SIZE(node.children):