/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to tools/time_graph.py

  • Committer: Jelmer Vernooij
  • Date: 2017-05-22 00:56:52 UTC
  • mfrom: (6621.2.26 py3_pokes)
  • Revision ID: jelmer@jelmer.uk-20170522005652-yjahcr9hwmjkno7n
Merge Python3 porting work ('py3 pokes')

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
    b.unlock()
39
39
end = time.clock()
40
40
 
41
 
print 'Found %d nodes, loaded in %.3fs' % (len(parent_map), end - begin)
 
41
print('Found %d nodes, loaded in %.3fs' % (len(parent_map), end - begin))
42
42
 
43
43
def all_heads_comp(g, combinations):
44
44
    h = []
72
72
if opts.max_combinations > 0 and len(combinations) > opts.max_combinations:
73
73
    combinations = random.sample(combinations, opts.max_combinations)
74
74
 
75
 
print '      %d combinations' % (len(combinations),)
 
75
print('      %d combinations' % (len(combinations),))
76
76
 
77
77
def combi_graph(graph_klass, comb):
78
78
    # DEBUG
89
89
    return dict(elapsed=(end - begin), graph=g, heads=heads)
90
90
 
91
91
def report(name, g):
92
 
    print '%s: %.3fs' % (name, g['elapsed'])
 
92
    print('%s: %.3fs' % (name, g['elapsed']))
93
93
    counters_used = False
94
94
    for c in graph._counters:
95
95
        if c:
96
96
            counters_used = True
97
97
    if counters_used:
98
 
        print '  %s' % (graph._counters,)
 
98
        print('  %s' % (graph._counters,))
99
99
 
100
100
known_python = combi_graph(_known_graph_py.KnownGraph, combinations)
101
101
report('Known', known_python)
109
109
if opts.quick:
110
110
    if known_python['heads'] != known_pyrex['heads']:
111
111
        import pdb; pdb.set_trace()
112
 
    print 'ratio: %.1f:1 faster' % (
113
 
        known_python['elapsed'] / known_pyrex['elapsed'],)
 
112
    print('ratio: %.1f:1 faster' % (
 
113
        known_python['elapsed'] / known_pyrex['elapsed'],))
114
114
else:
115
115
    orig = combi_graph(_simple_graph, combinations)
116
116
    report('Orig', orig)
118
118
    if orig['heads'] != known_pyrex['heads']:
119
119
        import pdb; pdb.set_trace()
120
120
 
121
 
    print 'ratio: %.1f:1 faster' % (
122
 
        orig['elapsed'] / known_pyrex['elapsed'],)
 
121
    print('ratio: %.1f:1 faster' % (
 
122
        orig['elapsed'] / known_pyrex['elapsed'],))