~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/benchmarks/bench_bench.py

  • Committer: Robey Pointer
  • Date: 2006-09-08 18:46:29 UTC
  • mto: This revision was merged to the branch mainline in revision 1996.
  • Revision ID: robey@lag.net-20060908184629-e3fc4c61ca21508c
pychecker is on crack; go back to using 'is None'.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2006 Canonical Ltd
 
1
# Copyright (C) 2006 by Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
 
# it under the terms of the GNU General Public License as published by
5
 
# the Free Software Foundation; either version 2 of the License, or
6
 
# (at your option) any later version.
 
4
# it under the terms of the GNU General Public License version 2 as published by
 
5
# the Free Software Foundation.
7
6
#
8
7
# This program is distributed in the hope that it will be useful,
9
8
# but WITHOUT ANY WARRANTY; without even the implied warranty of
12
11
#
13
12
# You should have received a copy of the GNU General Public License
14
13
# along with this program; if not, write to the Free Software
15
 
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 
14
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
15
 
17
16
"""Tests for bzr benchmark utilities performance."""
18
17
 
29
28
 
30
29
 
31
30
class MakeKernelLikeTreeBenchmark(Benchmark):
32
 
    """Benchmark creating benchmark trees."""
33
31
 
34
32
    def test_make_kernel_like_tree(self):
35
 
        """Making a kernel sized tree should be ~ 5seconds on modern disk."""
 
33
        """Making a kernel sized tree should be ~ 5seconds on modern disk.""" 
36
34
        # on roberts machine: this originally took:  7372ms/ 7479ms
37
35
        # with the LocalTransport._abspath call:     3730ms/ 3778ms
38
36
        # with AtomicFile tuning:                    2888ms/ 2926ms
39
 
        # switching to transport.append_bytes:       1468ms/ 2849ms
 
37
        # switching to transport.append:             1468ms/ 2849ms
40
38
        self.time(self.make_kernel_like_tree)
41
39
 
42
40
    def test_02_make_kernel_like_tree(self):
55
53
        self.time(creator.create, root='foo')
56
54
 
57
55
    def test_04_make_kernel_like_added_tree(self):
58
 
        """Time the second creation of a kernel like added tree
 
56
        """Time the second creation of a kernel like added tree 
59
57
        (this should be a clone)
60
58
        """
61
59
        # make sure kernel_like_added_tree is cached
73
71
        self.time(creator.create, root='foo')
74
72
 
75
73
    def test_06_make_kernel_like_committed_tree(self):
76
 
        """Time the second creation of a committed kernel like tree
 
74
        """Time the second creation of a committed kernel like tree 
77
75
        (this should be a clone)
78
76
        """
79
77
        creator = KernelLikeCommittedTreeCreator(self,
86
84
        self.time(creator.create, root='bar')
87
85
 
88
86
    def test_07_make_kernel_like_committed_tree_hardlink(self):
89
 
        """Time the creation of a committed kernel like tree
 
87
        """Time the creation of a committed kernel like tree 
90
88
        (this should also hardlink the .bzr/ directory)
91
89
        """
92
90
        creator = KernelLikeCommittedTreeCreator(self,