Skip to content

Commit

Permalink
Add authoring benchmarks section
Browse files Browse the repository at this point in the history
  • Loading branch information
dianaclarke committed Jun 21, 2021
1 parent 5ccd9c3 commit 524420f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 24 deletions.
27 changes: 3 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -219,12 +219,7 @@ class SimpleBenchmark(conbench.runner.Benchmark):
def func():
return 1 + 1
tags = {"year": "2020"}
context = {"benchmark_language": "Python"}
github_info = {
"commit": "02addad336ba19a654f9c857ede546331be7b631",
"repository": "https://github.com/apache/arrow",
}
tags, context, github_info = {}, {}, {} # user defined
benchmark, output = self.conbench.benchmark(
func,
self.name,
Expand Down Expand Up @@ -275,13 +270,6 @@ class ExternalBenchmark(conbench.runner.Benchmark):
self.conbench = conbench.runner.Conbench()
def run(self, **kwargs):
tags = {"year": "2020"}
context = {"benchmark_language": "Python"}
github_info = {
"commit": "02addad336ba19a654f9c857ede546331be7b631",
"repository": "https://github.com/apache/arrow",
}
# external results from somewhere
# (an API call, command line execution, etc)
result = {
Expand All @@ -291,6 +279,7 @@ class ExternalBenchmark(conbench.runner.Benchmark):
"time_unit": "s",
}
tags, context, github_info = {}, {}, {} # user defined
benchmark, output = self.conbench.record(
result,
self.name,
Expand Down Expand Up @@ -371,19 +360,9 @@ class CasesBenchmark(conbench.runner.Benchmark):
def func():
return 100 - 1
context = {"benchmark_language": "Python"}
github_info = {
"commit": "02addad336ba19a654f9c857ede546331be7b631",
"repository": "https://github.com/apache/arrow",
}
tags, context, github_info = {}, {}, {} # user defined
for case in self.get_cases(case, kwargs):
color, fruit = case
tags = {
"color": color,
"fruit": fruit,
"count": count,
"dataset": source,
}
benchmark, output = self.conbench.benchmark(
func,
self.name,
Expand Down
2 changes: 2 additions & 0 deletions conbench/tests/benchmark/test_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def test_runner_simple_benchmark():
assert_keys_equal(result, example)
assert_keys_equal(result["tags"], expected_tags)
assert_keys_equal(result["stats"], example["stats"])
assert_keys_equal(result["context"], example["context"])
assert_keys_equal(result["machine_info"], example["machine_info"])
assert result["tags"] == expected_tags
assert result["stats"]["iterations"] == 10
Expand All @@ -112,6 +113,7 @@ def test_runner_case_benchmark():
assert_keys_equal(result, example)
assert_keys_equal(result["tags"], expected_tags)
assert_keys_equal(result["stats"], example["stats"])
assert_keys_equal(result["context"], example["context"])
assert_keys_equal(result["machine_info"], example["machine_info"])
assert result["tags"] == expected_tags
assert result["stats"]["iterations"] == 10
Expand Down

0 comments on commit 524420f

Please sign in to comment.