diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-22 19:17:03 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-22 19:17:03 +0200 |
| commit | b260a2f2ccd8e6b81085f132849c8df41488af49 (patch) | |
| tree | 8f25f672be187316d6c73f5b1bde0632f82b96ac | |
| parent | 85987eda7c338fd0d73a7f7d3e51a405e1ac66f4 (diff) | |
| download | allocbench-b260a2f2ccd8e6b81085f132849c8df41488af49.tar.gz allocbench-b260a2f2ccd8e6b81085f132849c8df41488af49.zip | |
stop saving or calculating stats of allocators without measurements
| -rw-r--r-- | src/benchmark.py | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/benchmark.py b/src/benchmark.py index 1cfc5f8..890d414 100644 --- a/src/benchmark.py +++ b/src/benchmark.py @@ -124,6 +124,10 @@ class Benchmark (object): save_data.update(self.results) save_data["stats"] = {} for allocator in self.results["allocators"]: + # Skip allocators without measurements + if self.results[allocator] == {}: + continue + measures = [] stats = [] for ntuple in self.iterate_args(args=self.results["args"]): @@ -151,6 +155,7 @@ class Benchmark (object): f = path print_info("Loading results from:", f) + # TODO merge loaded result with open(f, "rb") as f: self.results = pickle.load(f) # Build new named tuples @@ -166,7 +171,7 @@ class Benchmark (object): d[self.Perm(**perm)] = value self.results["stats"][allocator] = d - # add missing statistics + # add eventual missing statistics if "stats" not in self.results: self.calc_desc_statistics() @@ -429,12 +434,15 @@ class Benchmark (object): self.calc_desc_statistics() def calc_desc_statistics(self): - if "stats" in self.results: - return allocs = self.results["allocators"] self.results["stats"] = {} for alloc in allocs: + # Skip allocators without measurements + if self.results[alloc] == {}: + continue + self.results["stats"][alloc] = {} + for perm in self.iterate_args(self.results["args"]): stats = {s: {} for s in ["min", "max", "mean", "median", "std", "std_perc", |
