Skip to content

Commit

Permalink
Pretty output
Browse files Browse the repository at this point in the history
  • Loading branch information
codygunton committed Feb 27, 2024
1 parent 4b4ef09 commit 7deeb99
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions barretenberg/cpp/scripts/analyze_client_ivc_bench.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,11 @@
sum_of_kept_times_ms = sum(float(time) for _, time in bench_components.items())/1e6
total_time_ms = bench["real_time"]

print(f'Total time accounted for: {sum_of_kept_times_ms:.0f}ms/{total_time_ms:.0f}ms = {sum_of_kept_times_ms/total_time_ms:.2%}')
print('breakdown:')
MAX_LABEL_LENGTH = max(len(label) for label in to_keep)
column = {"label":"label", "ms":"ms", "%":"% total"}
print(f"{column['label']:<{MAX_LABEL_LENGTH}}{column['ms']:>8} {column['%']:>8}")
for key in to_keep:
time_ms = bench[key]/1e6
print(key, f"{time_ms: .0f}ms, {time_ms/total_time_ms: .2%}")
print(f"{key:<{MAX_LABEL_LENGTH}}{time_ms:>8.0f} {time_ms/total_time_ms:>8.2%}")

print(f'\nTotal time accounted for: {sum_of_kept_times_ms:.0f}ms/{total_time_ms:.0f}ms = {sum_of_kept_times_ms/total_time_ms:.2%}')

0 comments on commit 7deeb99

Please sign in to comment.