~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to tools/weavebench.py

  • Committer: Martin Pool
  • Date: 2005-07-17 18:06:53 UTC
  • Revision ID: mbp@sourcefrog.net-20050717180653-f16d08bd74610f6d
- update more weave code to use intsets

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, seed
 
26
from random import randrange, randint
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 = 2000
33
 
 
34
 
seed(0)
 
32
NUM_REVS = 10000
35
33
 
36
34
def build():
37
 
    pb = ProgressBar(show_eta=False)
 
35
    pb = ProgressBar()
38
36
 
39
37
    wf = Weave()
40
38
    lines = []
91
89
            
92
90
 
93
91
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:
103
92
    profileit(build)
104
93
else:
105
94
    build()