From 8174a918ea3b7cb216bf7ea98cfdc10661b5c37d Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Wed, 6 May 2020 16:56:32 +0200 Subject: make the whole project more python idiomatic * rename src directory to allocbench * make global variable names UPPERCASE * format a lot of code using yapf * use lowercase ld_preload and ld_library_path as Allocator members * name expected Errors 'err' and don't raise a new Exception * disable some pylint messages --- src/benchmarks/fd.py | 93 ---------------------------------------------------- 1 file changed, 93 deletions(-) delete mode 100644 src/benchmarks/fd.py (limited to 'src/benchmarks/fd.py') diff --git a/src/benchmarks/fd.py b/src/benchmarks/fd.py deleted file mode 100644 index 1fdd96a..0000000 --- a/src/benchmarks/fd.py +++ /dev/null @@ -1,93 +0,0 @@ -# Copyright 2018-2019 Florian Fischer -# -# This file is part of allocbench. -# -# allocbench is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# allocbench is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with allocbench. If not, see . -"""Definition of the fd benchmark""" - -import os -import re -from urllib.request import urlretrieve - -from src.artifact import ArchiveArtifact, GitArtifact -from src.benchmark import Benchmark -import src.plots as plt -from src.util import print_info - - -class BenchmarkFd(Benchmark): - """fd benchmark - """ - def __init__(self): - name = "fd" - super().__init__(name) - - self.cmd = "fd -HI -e c '.*[0-9].*' {linux_files}" - - def prepare(self): - super().prepare() - - linux = GitArtifact( - "linux", - "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git") - linux_version = "v5.3" - self.linux_files = linux.provide(linux_version) - - if os.path.exists(self.build_dir): - return - - fd_version = "v7.4.0" - self.results["facts"]["versions"]["fd"] = fd_version - fd_url = ("https://github.com/sharkdp/fd/releases/latest/download/" - f"fd-{fd_version}-x86_64-unknown-linux-gnu.tar.gz") - - fd = ArchiveArtifact("fd", fd_url, "tar", - "a5d8e7c8484449aa324a46abfdfaf026d7de77ee") - - fd_dir = os.path.join(self.build_dir, "fd_sources") - fd.provide(fd_dir) - - # create symlinks - for exe in ["fd"]: - src = os.path.join(fd_dir, - f"fd-{fd_version}-x86_64-unknown-linux-gnu", - exe) - dest = os.path.join(self.build_dir, exe) - os.link(src, dest) - - def summary(self): - plt.plot(self, - "{task-clock}", - plot_type='bar', - fig_options={ - 'ylabel': "runtime in ms", - 'title': "fd runtime", - }, - file_postfix="runtime") - - plt.export_stats_to_dataref(self, "task-clock") - - plt.plot(self, - "{VmHWM}", - plot_type='bar', - fig_options={ - 'ylabel': "VmHWM in KB", - 'title': "fd memusage" - }, - file_postfix="memusage") - - plt.export_stats_to_dataref(self, "VmHWM") - - -fd = BenchmarkFd() -- cgit v1.2.3