##// END OF EJS Templates
revsetbenchmarks: display even more compact timing result...
Pierre-Yves David -
r25541:80ce5bce default
parent child Browse files
Show More
@@ -145,22 +145,30 b' def formatfactor(factor):'
145 145 factor //= 0
146 146 return 'x%ix%i' % (factor, order)
147 147
148 def formattiming(value):
149 """format a value to strictly 8 char, dropping some precision if needed"""
150 if value < 10**7:
151 return ('%.6f' % value)[:8]
152 else:
153 # value is HUGE very unlikely to happen (4+ month run)
154 return '%i' % value
155
148 156 _marker = object()
149 157 def printresult(variants, idx, data, maxidx, verbose=False, reference=_marker):
150 158 """print a line of result to stdout"""
151 159 mask = '%%0%ii) %%s' % idxwidth(maxidx)
152 160 out = []
153 161 for var in variants:
154 out.append('%10.6f' % data[var]['wall'])
162 out.append(formattiming(data[var]['wall']))
155 163 if reference is not _marker:
156 164 factor = None
157 165 if reference is not None:
158 166 factor = getfactor(reference[var], data[var], 'wall')
159 167 out.append(formatfactor(factor))
160 168 if verbose:
161 out.append('%10.6f' % data[var]['comb'])
162 out.append('%10.6f' % data[var]['user'])
163 out.append('%10.6f' % data[var]['sys'])
169 out.append(formattiming(data[var]['comb']))
170 out.append(formattiming(data[var]['user']))
171 out.append(formattiming(data[var]['sys']))
164 172 out.append('%6d' % data[var]['count'])
165 173 print mask % (idx, ' '.join(out))
166 174
@@ -169,6 +177,8 b' def printheader(variants, maxidx, verbos'
169 177 for var in variants:
170 178 if not var:
171 179 var = 'iter'
180 if 8 < len(var):
181 var = var[:3] + '..' + var[-3:]
172 182 header.append(' %-8s' % var)
173 183 if relative:
174 184 header.append(' ')
General Comments 0
You need to be logged in to leave comments. Login now