diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-10-16 18:34:03 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-10-16 18:34:03 +0200 |
| commit | 26413f57a266454294f66f636a1d225109a917d0 (patch) | |
| tree | e796b0c98994c13498db2286f81833897d998b1f | |
| parent | 451632863ec751c66ecf989975ab32bdbb8cb750 (diff) | |
| download | allocbench-26413f57a266454294f66f636a1d225109a917d0.tar.gz allocbench-26413f57a266454294f66f636a1d225109a917d0.zip | |
improve top10 percentages
| -rwxr-xr-x | src/chattyparser.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/chattyparser.py b/src/chattyparser.py index 2fb2070..0bd6821 100755 --- a/src/chattyparser.py +++ b/src/chattyparser.py @@ -199,14 +199,14 @@ def plot_hist_ascii(path, hist, calls): top10 = [t[1] for t in sorted([(n, s) for s, n in hist.items()])[-10:]] top10_total = sum([hist[size] for size in top10]) - print(f"Top 10 allocation sizes {top10_total / total:.2f}% of all allocations", file=hist_file) + print(f"Top 10 allocation sizes {(top10_total/total)*100:.2f}% of all allocations", file=hist_file) for i, size in enumerate(reversed(top10)): print(f"{i+1}. {size} B occurred {hist[size]} times", file=hist_file) print(file=hist_file) - print("allocations <= 64", sum([n for s, n in hist.items() if s <= 64]), file=hist_file) - print("allocations <= 1024", sum([n for s, n in hist.items() if s <= 1024]), file=hist_file) - print("allocations <= 4096", sum([n for s, n in hist.items() if s <= 4096]), file=hist_file) + for i in [64, 1024, 4096]: + allocations = sum([n for s, n in hist.items() if s <= i]) + print(f"allocations <= {i}: {allocations} {(allocations/total)*100:.2f}%", file=hist_file) print(file=hist_file) print("Histogram of sizes:", file=hist_file) |
