Initialize a JavaMicrobenchmarkHarness. Parameters ---------- name: str Name of the benchmark forks: int warmups: int runs: int runs: list(JavaMicrobenchmarkHarnessObservation) Repetitions of JavaMicrobenchmarkHarn
(self, name, runs)
| 159 | """ A set of JavaMicrobenchmarkHarnessObservations. """ |
| 160 | |
| 161 | def __init__(self, name, runs): |
| 162 | """ Initialize a JavaMicrobenchmarkHarness. |
| 163 | |
| 164 | Parameters |
| 165 | ---------- |
| 166 | name: str |
| 167 | Name of the benchmark |
| 168 | forks: int |
| 169 | warmups: int |
| 170 | runs: int |
| 171 | runs: list(JavaMicrobenchmarkHarnessObservation) |
| 172 | Repetitions of JavaMicrobenchmarkHarnessObservation run. |
| 173 | |
| 174 | """ |
| 175 | self.name = name |
| 176 | self.runs = sorted(runs, key=lambda b: b.value) |
| 177 | unit = self.runs[0].unit |
| 178 | time_unit = "N/A" |
| 179 | less_is_better = not unit.endswith("per_second") |
| 180 | values = [b.value for b in self.runs] |
| 181 | times = [] |
| 182 | # Slight kludge to extract the UserCounters for each benchmark |
| 183 | counters = self.runs[0].counters |
| 184 | super().__init__(name, unit, less_is_better, values, time_unit, times, |
| 185 | counters) |
| 186 | |
| 187 | def __repr__(self): |
| 188 | return f"JavaMicrobenchmark[name={self.name},runs={self.runs}]" |
nothing calls this directly
no outgoing calls
no test coverage detected