From 93e3aac6315c17a74e63f02053a3e8e2e6b21928 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Tue, 27 Aug 2019 16:54:17 +0200 Subject: improve benchmark code quality using pylint The description Benchmark member is replaced with class docstrings --- src/benchmarks/loop.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) (limited to 'src/benchmarks/loop.py') 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() -- cgit v1.2.3