~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/bench_workingtree.py

  • Committer: Canonical.com Patch Queue Manager
  • Date: 2007-03-07 10:45:44 UTC
  • mfrom: (2321.1.2 integration)
  • Revision ID: pqm@pqm.ubuntu.com-20070307104544-59e3e6358e4bdb29
(robertc) Merge dirstate and subtrees. (Robert Collins, Martin Pool, Aaaron Bentley, John A Meinel, James Westby)

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
 
28
28
    def test_list_files_kernel_like_tree(self):
29
29
        tree = self.make_kernel_like_added_tree()
30
 
        self.time(list, tree.list_files())
 
30
        tree.lock_read()
 
31
        try:
 
32
            self.time(list, tree.list_files())
 
33
        finally:
 
34
            tree.unlock()
31
35
 
32
36
    def test_list_files_unknown_kernel_like_tree(self):
33
37
        tree = self.make_kernel_like_tree(link_working=True)
41
45
            if root == '.':
42
46
                continue
43
47
            tree.add(root)
44
 
        self.time(list, tree.list_files())
 
48
        tree.lock_read()
 
49
        try:
 
50
            self.time(list, tree.list_files())
 
51
        finally:
 
52
            tree.unlock()
45
53
 
46
54
    def test_is_ignored_single_call(self):
47
55
        """How long does is_ignored take to initialise and check one file."""
84
92
        self.time(t.is_ignored,'bar')
85
93
        ignores._runtime_ignores = set()
86
94
 
 
95
    def test_walkdirs_kernel_like_tree(self):
 
96
        """Walking a kernel sized tree is fast!(150ms)."""
 
97
        self.make_kernel_like_tree()
 
98
        self.run_bzr('add')
 
99
        tree = WorkingTree.open('.')
 
100
        # on roberts machine: this originally took:  157ms/4177ms
 
101
        # plain os.walk takes 213ms on this tree
 
102
        self.time(list, tree.walkdirs())
87
103
 
 
104
    def test_walkdirs_kernel_like_tree_unknown(self):
 
105
        """Walking a kernel sized tree is fast!(150ms)."""
 
106
        self.make_kernel_like_tree()
 
107
        tree = WorkingTree.open('.')
 
108
        # on roberts machine: this originally took:  157ms/4177ms
 
109
        # plain os.walk takes 213ms on this tree
 
110
        self.time(list, tree.walkdirs())