diff options
| author | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-27 16:54:17 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fl.fischer@fau.de> | 2019-08-27 16:54:17 +0200 |
| commit | 93e3aac6315c17a74e63f02053a3e8e2e6b21928 (patch) | |
| tree | 6f1c22dff617e05807a88c107389654cbaf7d090 /src/benchmarks/loop.py | |
| parent | ce532bbe9c03e52f80d263ea02038e9b81696e89 (diff) | |
| download | allocbench-93e3aac6315c17a74e63f02053a3e8e2e6b21928.tar.gz allocbench-93e3aac6315c17a74e63f02053a3e8e2e6b21928.zip | |
improve benchmark code quality using pylint
The description Benchmark member is replaced with class docstrings
Diffstat (limited to 'src/benchmarks/loop.py')
| -rw-r--r-- | src/benchmarks/loop.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/benchmarks/loop.py b/src/benchmarks/loop.py index 58d4935..a20924a 100644 --- a/src/benchmarks/loop.py +++ b/src/benchmarks/loop.py @@ -1,12 +1,16 @@ +"""Definition of the loop micro benchmark""" + from src.benchmark import Benchmark -from src.allocators.bumpptr import bumpptr -class Benchmark_Loop(Benchmark): +class BenchmarkLoop(Benchmark): + """Loop micro benchmark + + This benchmark allocates and frees n blocks in t concurrent threads. + """ + def __init__(self): self.name = "loop" - self.descrition = """This benchmark allocates and frees n blocks in t concurrent - threads.""" self.cmd = "loop{binary_suffix} {nthreads} 1000000 {maxsize}" @@ -16,9 +20,6 @@ class Benchmark_Loop(Benchmark): self.requirements = ["loop"] super().__init__() - # add bumpptr alloc - self.allocators["bumpptr"] = bumpptr.build() - def summary(self): # Speed self.plot_fixed_arg("perm.nthreads / ({task-clock}/1000)", @@ -30,7 +31,7 @@ class Benchmark_Loop(Benchmark): scale = list(self.results["allocators"].keys())[0] self.plot_fixed_arg("perm.nthreads / ({task-clock}/1000)", ylabel='"MOPS/cpu-second normalized {}"'.format(scale), - title='"Loop: " + arg + " " + str(arg_value) + " normalized {}"'.format(scale), + title=f'"Loop: " + arg + " " + str(arg_value) + " normalized {scale}"', filepostfix="time.norm", scale=scale, autoticks=False) @@ -50,4 +51,4 @@ class Benchmark_Loop(Benchmark): self.export_stats_to_dataref("task-clock") -loop = Benchmark_Loop() +loop = BenchmarkLoop() |
