feat: add 5 experiment
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
import argparse
|
||||
import json
|
||||
import statistics
|
||||
from pathlib import Path
|
||||
|
||||
import matplotlib
|
||||
|
||||
matplotlib.use("Agg")
|
||||
import matplotlib.pyplot as plt
|
||||
|
||||
parser = argparse.ArgumentParser(__doc__)
|
||||
parser.add_argument("series")
|
||||
args = parser.parse_args()
|
||||
directory = Path(__file__).resolve().parents[3] / "evidence/grade5" / args.series
|
||||
runs = json.loads(directory.joinpath("analysis.json").read_text())["runs"]
|
||||
assert len({r["rate"] for r in runs}) == 1, "Use a fixed-rate study"
|
||||
figure, ax = plt.subplots(figsize=(8, 4.5), layout="constrained")
|
||||
groups = [[r["p95_ms"] for r in runs if r["config"] == c] for c in ("I0", "I1")]
|
||||
ax.bar(
|
||||
[0, 1],
|
||||
[statistics.median(g) for g in groups],
|
||||
color=["#0072B2", "#D55E00"],
|
||||
alpha=0.25,
|
||||
width=0.5,
|
||||
)
|
||||
for repeat, color in zip(
|
||||
sorted({r["repeat"] for r in runs}), ("#0072B2", "#009E73", "#CC79A7")
|
||||
):
|
||||
pair = {r["config"]: r for r in runs if r["repeat"] == repeat}
|
||||
ax.plot(
|
||||
[0, 1],
|
||||
[pair[c]["p95_ms"] for c in ("I0", "I1")],
|
||||
"o-",
|
||||
color=color,
|
||||
label=f"Repeat {repeat}",
|
||||
)
|
||||
ax.set_xticks([0, 1], ["Control: GOMAXPROCS=16", "Tuned: GOMAXPROCS=1"])
|
||||
ax.set_ylim(bottom=0)
|
||||
ax.set_ylabel("p95 full latency of successful responses (ms)")
|
||||
rate = runs[0]["rate"]
|
||||
ax.set_title(f"Paired repetitions at {rate} requests/s; bars show medians")
|
||||
ax.grid(axis="y", alpha=0.25)
|
||||
ax.legend()
|
||||
figure.savefig(directory / "latency-pairs.png", dpi=160)
|
||||
plt.close(figure)
|
||||
Reference in New Issue
Block a user