From 84eec0baba49bff0a5c2b64834bc2d75d687e7b5 Mon Sep 17 00:00:00 2001 From: Florian Fischer Date: Sat, 21 Sep 2019 14:04:26 +0200 Subject: add artifacts Artifacts are downloadable external ressources. They provide their ressource (vcs commit, extracted archive) using Artifact.provide. GitArtifact download a bare git repository and provides specific commits using worktrees. Use GitArtifact for the linux kernel source --- src/benchmarks/fd.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'src/benchmarks') diff --git a/src/benchmarks/fd.py b/src/benchmarks/fd.py index d78988a..55fe3af 100644 --- a/src/benchmarks/fd.py +++ b/src/benchmarks/fd.py @@ -23,10 +23,15 @@ import subprocess import sys from urllib.request import urlretrieve +from src.artifact import GitArtifact from src.benchmark import Benchmark from src.util import print_info, download_reporthook +LINUX_ARTIFACT = GitArtifact("linux", "git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git") +LINUX_VERSION = "v5.3" + + class BenchmarkFd(Benchmark): """fd benchmark """ @@ -36,7 +41,7 @@ class BenchmarkFd(Benchmark): super().__init__(name) - self.cmd = "fd -HI -e c \"\" {build_dir}/linux" + self.cmd = "fd -HI -e c '.*[0-9].*' {build_dir}/linux" def prepare(self): super().prepare() @@ -75,15 +80,8 @@ class BenchmarkFd(Benchmark): dest = os.path.join(self.build_dir, exe) os.link(src, dest) - linux_version = "v5.3" - linux_url = f"git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git" - linux_dir = os.path.join(self.build_dir, "linux") - if not os.path.isdir(linux_dir): - # Extract redis - proc = subprocess.run(["git", "clone", linux_url, linux_dir], - # stdout=subprocess.PIPE, stderr=subprocess.PIPE, - universal_newlines=True) + LINUX_ARTIFACT.provide(LINUX_VERSION, os.path.join(self.build_dir, "linux")) def summary(self): self.barplot_single_arg("{task-clock}", -- cgit v1.2.3