Skip to content

Commit c6162c1

Browse files
committed
Add new processing script for results plotting
This uses percentile bootstrapping with 99% confidence intervals for geometric mean calculations
1 parent 8c5b83d commit c6162c1

File tree

4 files changed

+366
-50
lines changed

4 files changed

+366
-50
lines changed

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,5 @@ bare-metal: venv
7777
$(SUITE_ARG) \
7878
$(MEASURE_ARG)
7979

80+
process: venv
81+
@$(INVOKE) process-benchmarks

build.py

Lines changed: 56 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -41,25 +41,6 @@ class Metric(Enum):
4141
HEAPTRACK = "heaptrack"
4242

4343

44-
class Stats(Enum):
45-
GC_ALLOCS = "Gc allocated"
46-
RC_ALLOCS = "Rc allocated"
47-
ARC_ALLOCS = "Arc allocated"
48-
BOX_ALLOCS = "Box allocated"
49-
MUTATOR_TIME = "mutator time"
50-
GC_TIME = "GC time"
51-
GC_CYCLES = "num GCs"
52-
BARRIERS_VISITED = "barriers visited"
53-
FLZR_REGISTERED = "finalizers registered"
54-
FLZR_COMPLETED = "finalizers completed"
55-
FLZR_ELIDABLE = "finalizers elidable"
56-
WALLCLOCK = "wallclock"
57-
SYS = "sys"
58-
59-
def __lt__(self, other):
60-
return self.value < other.value
61-
62-
6344
class ExperimentProfile(Enum):
6445

6546
def __init__(self, value, latex, alloy_flags=None):
@@ -154,6 +135,16 @@ def path(self) -> Path:
154135
def latex(self) -> str:
155136
return f"\\{self.name.replace('-','')}"
156137

138+
@property
139+
def results(self):
140+
from results import SuiteData
141+
142+
results = SuiteData.for_measurements(self, [Metric.PERF, Metric.METRICS])
143+
return results
144+
145+
def raw_data(self, measurement) -> Path:
146+
return RESULTS_DIR / self.name / measurement.value / "results.data"
147+
157148
@property
158149
def args(self) -> str:
159150
return self.cmd_args
@@ -260,6 +251,25 @@ def run(self, c, pexecs, config):
260251
f"Setup process {setup_proc.pid} terminated with status ({setup_proc.poll()})"
261252
)
262253

254+
def configurations(self, only_installed=False, only_missing=False):
255+
if only_installed and only_missing:
256+
raise ValueError("Can't select both only_installed and only_missing")
257+
258+
identical = [GCVS.GC, PremOpt.OPT, Elision.OPT]
259+
executors = set()
260+
261+
for p in self.profiles:
262+
name = "default" if p in identical else p.full
263+
is_metrics = self.measurement == Metric.METRICS
264+
alloy = Alloy(p, metrics=is_metrics)
265+
executors.add(Executor(self, self.suite, self.measurement, name, alloy))
266+
267+
if only_installed:
268+
executors = [self for self in executors if self.installed]
269+
elif only_missing:
270+
executors = [self for self in executors if not self.installed]
271+
return executors
272+
263273
@property
264274
def results(self) -> Path:
265275
return RESULTS_DIR / self.suite.name / self.measurement.value / "results.data"
@@ -274,9 +284,10 @@ def experiment(self):
274284
def process(self):
275285
from results import Results
276286

277-
results = Results.from_raw_data(self)
278-
summary = results.summary()
279-
print(summary)
287+
if not self.results.exists():
288+
logging.info(f"No results to process for {self.name}")
289+
return
290+
280291

281292
# print(plotter.mem_measurements)
282293
# print(plotter.wallclock)
@@ -448,8 +459,28 @@ def run(self, c, pexecs):
448459
e.run(c, pexecs, self.config)
449460

450461
def process(self, c):
451-
for e in self.experiments:
452-
e.process()
462+
exp_name = "premopt"
463+
suite_exps = [e for e in self.experiments if e.experiment == exp_name]
464+
suites = set(e.suite for e in suite_exps)
465+
466+
all_exps = []
467+
468+
for s in suites:
469+
raw = s.results
470+
exps = [e for e in suite_exps if e.suite == s]
471+
for e in exps:
472+
if e.results.exists():
473+
results = raw.for_experiment(e)
474+
all_exps.append(results.summary().data)
475+
# print(e.name)
476+
# print()
477+
# print(data.summary().without_errs())
478+
# print()
479+
# print("=====")
480+
from results import Overall
481+
482+
overview = Overall(all_exps)
483+
overview.mk_perf_table()
453484

454485
def remove(self):
455486
for e in self.experiments:
@@ -540,20 +571,9 @@ def configurations(
540571
if only_installed and only_missing:
541572
raise ValueError("Can't select both only_installed and only_missing")
542573

543-
identical = [GCVS.GC, PremOpt.OPT, Elision.OPT]
544-
545574
executors = set()
546575
for e in self.experiments:
547-
for p in e.profiles:
548-
name = "default" if p in identical else p.full
549-
is_metrics = e.measurement == Metric.METRICS
550-
alloy = Alloy(p, metrics=is_metrics)
551-
executors.add(Executor(e, e.suite, e.measurement, name, alloy))
552-
553-
if only_installed:
554-
executors = [e for e in executors if e.installed]
555-
elif only_missing:
556-
executors = [e for e in executors if not e.installed]
576+
executors.update(e.configurations(only_installed, only_missing))
557577
return executors
558578

559579
@classmethod

0 commit comments

Comments
 (0)