aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Fischer <florian.fl.fischer@fau.de>2019-05-08 20:13:02 +0200
committerFlorian Fischer <florian.fl.fischer@fau.de>2019-05-08 20:15:54 +0200
commit509b10cb70eeb61f4799f36b545a9c8ad6565d9a (patch)
tree73319498789016ea1bbd323f2a2f144b15854811
parent9165590c987bc022424dc44030bd1149c2a93120 (diff)
downloadallocbench-509b10cb70eeb61f4799f36b545a9c8ad6565d9a.tar.gz
allocbench-509b10cb70eeb61f4799f36b545a9c8ad6565d9a.zip
add export to dataref
-rw-r--r--src/benchmark.py28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/benchmark.py b/src/benchmark.py
index 469be0b..b436c15 100644
--- a/src/benchmark.py
+++ b/src/benchmark.py
@@ -524,7 +524,33 @@ class Benchmark (object):
line = ""
for i, x in enumerate(rows[alloc][perm]):
line += str(x).ljust(widths[i])
- print(line, file=f)
+ print(line.replace("_", "-"), file=f)
+
+ def export_to_dataref(self, datapoint, path=None):
+ allocators = self.results["allocators"]
+ args = self.results["args"]
+ stats = self.results["stats"]
+
+ if path is None:
+ path = datapoint
+
+ path = path + ".dataref"
+
+ # Example: \drefset{/mysql/glibc/40/Lower-whisker}{71552.0}
+ line = "\drefset{{/{}/{}/{}/{}}}{{{}}}"
+
+ with open(path, "w") as f:
+ for alloc in allocators:
+ for perm in self.iterate_args(args=args):
+ for statistic, values in stats[alloc][perm].items():
+ cur_line = line.format(self.name, alloc,
+ "/".join([str(p) for p in list(perm)]),
+ statistic, values[datapoint])
+ # Replace empty outliers
+ cur_line.replace("[]", "")
+ # Replace underscores
+ cur_line.replace("_", "-")
+ print(cur_line, file=f)
def write_best_doublearg_tex_table(self, evaluation, sort=">",
filepostfix="", sumdir="", std=False):