Rev 5851: Remove the profiling code, down to 390ms in the function, 15.163s overall. in http://bazaar.launchpad.net/~jameinel/bzr/2.4-uncommit-faster

John Arbash Meinel john at arbash-meinel.com
Tue May 10 15:08:10 UTC 2011


At http://bazaar.launchpad.net/~jameinel/bzr/2.4-uncommit-faster

------------------------------------------------------------
revno: 5851
revision-id: john at arbash-meinel.com-20110510150803-e1inbruqru2ob8o7
parent: john at arbash-meinel.com-20110510145746-tg3vtkmgiofm0xhb
committer: John Arbash Meinel <john at arbash-meinel.com>
branch nick: 2.4-uncommit-faster
timestamp: Tue 2011-05-10 17:08:03 +0200
message:
  Remove the profiling code, down to 390ms in the function, 15.163s overall.
-------------- next part --------------
=== modified file 'bzrlib/dirstate.py'
--- a/bzrlib/dirstate.py	2011-05-10 14:57:46 +0000
+++ b/bzrlib/dirstate.py	2011-05-10 15:08:03 +0000
@@ -2611,11 +2611,6 @@
         # --- end generation of full tree mappings
 
         # sort and output all the entries
-        items = by_path.items()
-        self._sort_entries(items)
-        self._sort_entries(items)
-        self._sort_entries(items)
-
         new_entries = self._sort_entries(by_path.items())
         self._entries_to_current_state(new_entries)
         self._parents = [rev_id for rev_id, tree in trees]
@@ -2631,7 +2626,6 @@
         it's easier to sort after the fact.
         """
         split_dirs = {}
-        stats = [0, 0]
         def _key(entry, _split_dirs=split_dirs, st=static_tuple.StaticTuple,
                  as_st=static_tuple.StaticTuple.from_sequence):
             # sort by: directory parts, file name, file id
@@ -2642,11 +2636,7 @@
                 split = as_st(dirpath.split('/'))
                 _split_dirs[dirpath] = split
             return st(split, fname, file_id)
-        t = time.clock()
-        sort_vals = sorted(entry_list, key=_key)
-        t = time.clock() - t
-        trace.note('%.3fs Hit %d, miss %d' % (t, stats[0], stats[1]))
-        return sort_vals
+        return sorted(entry_list, key=_key)
 
     def set_state_from_inventory(self, new_inv):
         """Set new_inv as the current state.



More information about the bazaar-commits mailing list