(results: dict, image_name: str)
| 249 | |
| 250 | |
| 251 | def build_xlang_section(results: dict, image_name: str) -> str: |
| 252 | lines = [ |
| 253 | "## Xlang Benchmark\n\n", |
| 254 | "Run from `benchmarks/java/run.sh`. Raw JMH JSON stays under the ignored local " |
| 255 | "`benchmarks/java/reports/` directory; `throughput.png` and this xlang " |
| 256 | "section are synced into `docs/benchmarks/java/`.\n\n", |
| 257 | "```bash\n", |
| 258 | "cd benchmarks/java\n", |
| 259 | "./run.sh\n", |
| 260 | "```\n\n", |
| 261 | "JMH parameters: `-f 1 -wi 3 -i 3 -t 1 -w 3s -r 3s -bm thrpt -tu s`. " |
| 262 | "Higher throughput is better.\n\n", |
| 263 | f"\n\n", |
| 264 | "| Data type | Operation | " |
| 265 | + " | ".join( |
| 266 | f"{serializer_title(serializer)} ops/sec" for serializer in SERIALIZER_ORDER |
| 267 | ) |
| 268 | + " | Fastest |\n", |
| 269 | "|-----------|-----------|" |
| 270 | + "|".join("---:" for _ in SERIALIZER_ORDER) |
| 271 | + "|---------|\n", |
| 272 | ] |
| 273 | |
| 274 | for datatype in DATATYPE_ORDER: |
| 275 | for operation in OPERATIONS: |
| 276 | values = { |
| 277 | serializer: results.get(datatype, {}) |
| 278 | .get(operation, {}) |
| 279 | .get(serializer, 0.0) |
| 280 | for serializer in SERIALIZER_ORDER |
| 281 | } |
| 282 | lines.append( |
| 283 | f"| {datatype_title(datatype)} | {operation.capitalize()} | " |
| 284 | + " | ".join( |
| 285 | format_table_value(values[serializer]) |
| 286 | for serializer in SERIALIZER_ORDER |
| 287 | ) |
| 288 | + f" | {winner_cell(values)} |\n" |
| 289 | ) |
| 290 | return "".join(lines) |
| 291 | |
| 292 | |
| 293 | def write_local_readme(output_dir: Path, section: str) -> Path: |
no test coverage detected