~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/weavebench.py

  • Committer: Aaron Bentley
  • Date: 2005-07-26 14:06:11 UTC
  • mto: (1092.1.41) (1185.3.4) (974.1.47)
  • mto: This revision was merged to the branch mainline in revision 982.
  • Revision ID: abentley@panoramicfeedback.com-20050726140611-403e366f3c79c1f1
Fixed python invocation

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
from bzrlib.weave import Weave
24
24
from bzrlib.weavefile import write_weave
25
25
from bzrlib.progress import ProgressBar
26
 
from random import randrange, randint
 
26
from random import randrange, randint, seed
27
27
import tempfile
28
28
import hotshot, hotshot.stats
29
29
import sys
30
30
 
31
31
WEAVE_NAME = "bench.weave"
32
 
NUM_REVS = 10000
 
32
NUM_REVS = 2000
 
33
 
 
34
seed(0)
33
35
 
34
36
def build():
35
 
    pb = ProgressBar()
 
37
    pb = ProgressBar(show_eta=False)
36
38
 
37
39
    wf = Weave()
38
40
    lines = []
89
91
            
90
92
 
91
93
if '-p' in sys.argv[1:]:
 
94
    opt_p = True
 
95
    sys.argv.remove('-p')
 
96
else:
 
97
    opt_p = False
 
98
 
 
99
if len(sys.argv) > 1:
 
100
    NUM_REVS = int(sys.argv[1])
 
101
 
 
102
if opt_p:
92
103
    profileit(build)
93
104
else:
94
105
    build()