mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-07 06:43:00 +03:00
benchtests: Make compare_strings.py output a bit prettier
Make the column widths for the outputs fixed so that they look a little less messy. They will still look bad with lots of IFUNCs (like on x86) but it's still a step forward. * benchtests/scripts/compare_strings.py (process_results): Better spacing for output.
This commit is contained in:
@@ -1,5 +1,8 @@
|
|||||||
2017-09-16 Siddhesh Poyarekar <siddhesh@sourceware.org>
|
2017-09-16 Siddhesh Poyarekar <siddhesh@sourceware.org>
|
||||||
|
|
||||||
|
* benchtests/scripts/compare_strings.py (process_results):
|
||||||
|
Better spacing for output.
|
||||||
|
|
||||||
* benchtests/scripts/compare_strings.py: Use argparse.
|
* benchtests/scripts/compare_strings.py: Use argparse.
|
||||||
* benchtests/README: Document existence of compare_strings.py.
|
* benchtests/README: Document existence of compare_strings.py.
|
||||||
|
|
||||||
|
@@ -88,26 +88,28 @@ def process_results(results, attrs, base_func):
|
|||||||
|
|
||||||
for f in results['functions'].keys():
|
for f in results['functions'].keys():
|
||||||
print('Function: %s' % f)
|
print('Function: %s' % f)
|
||||||
|
v = results['functions'][f]['bench-variant']
|
||||||
|
print('Variant: %s' % v)
|
||||||
|
|
||||||
base_index = 0
|
base_index = 0
|
||||||
if base_func:
|
if base_func:
|
||||||
base_index = results['functions'][f]['ifuncs'].index(base_func)
|
base_index = results['functions'][f]['ifuncs'].index(base_func)
|
||||||
|
|
||||||
print('\t'.join(results['functions'][f]['ifuncs']))
|
print("%36s%s" % (' ', '\t'.join(results['functions'][f]['ifuncs'])))
|
||||||
v = results['functions'][f]['bench-variant']
|
print("=" * 120)
|
||||||
print('Variant: %s' % v)
|
|
||||||
print("=" * 80)
|
|
||||||
graph_res = {}
|
graph_res = {}
|
||||||
for res in results['functions'][f]['results']:
|
for res in results['functions'][f]['results']:
|
||||||
attr_list = ['%s=%s' % (a, res[a]) for a in attrs]
|
attr_list = ['%s=%s' % (a, res[a]) for a in attrs]
|
||||||
i = 0
|
i = 0
|
||||||
key = ', '.join(attr_list)
|
key = ', '.join(attr_list)
|
||||||
sys.stdout.write('%s: \t' % key)
|
sys.stdout.write('%36s: ' % key)
|
||||||
graph_res[key] = res['timings']
|
graph_res[key] = res['timings']
|
||||||
for t in res['timings']:
|
for t in res['timings']:
|
||||||
sys.stdout.write ('%.2f' % t)
|
sys.stdout.write ('%12.2f' % t)
|
||||||
if i != base_index:
|
if i != base_index:
|
||||||
diff = (res['timings'][base_index] - t) * 100 / res['timings'][base_index]
|
base = res['timings'][base_index]
|
||||||
sys.stdout.write (' (%.2f%%)' % diff)
|
diff = (base - t) * 100 / base
|
||||||
|
sys.stdout.write (' (%6.2f%%)' % diff)
|
||||||
sys.stdout.write('\t')
|
sys.stdout.write('\t')
|
||||||
i = i + 1
|
i = i + 1
|
||||||
print('')
|
print('')
|
||||||
|
Reference in New Issue
Block a user