Tweak benchmark script to handle missing benchmark files
This commit is contained in:
parent
a622a2e25b
commit
20a76112e7
1 changed files with 10 additions and 2 deletions
|
@ -29,8 +29,16 @@ files = [os.path.join(x, "benchmark.json") for x in directories]
|
|||
benchmark_data = {"Python": {}, "Golang": {}, "Nim": {}} # adding dicts here sets the order of points being plotted
|
||||
|
||||
for filename in files:
|
||||
with open(os.path.join(path, filename)) as f:
|
||||
data = json.load(f)
|
||||
fpath = os.path.join(path, filename)
|
||||
try:
|
||||
f = open(fpath)
|
||||
except FileNotFoundError:
|
||||
print(f"Warning: missing file {fpath}")
|
||||
continue
|
||||
|
||||
data = json.load(f)
|
||||
f.close()
|
||||
|
||||
for language in data["implementations"]:
|
||||
x = benchmark_data.get(language, {})
|
||||
x[str(data["day"]) + ".1"] = data["implementations"][language]["part.1.avg"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue