feat(perf): throughput dashboard + xlsxwriter fixture compat - #8
Conversation
Switch fixture generation from openpyxl to xlsxwriter to fix pylightxl read failures caused by namespace placement in xl/workbook.xml. Add formulas bulk-read scenarios, throughput dashboard script (run_throughput_dashboard.py), and group renderer output into Bulk Read / Bulk Write / Per-Cell sections for readability. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary of ChangesHello @wolfiesch, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the performance benchmarking infrastructure by addressing a critical issue with fixture generation compatibility, introducing a streamlined dashboard script for executing comprehensive performance tests, and improving the readability of benchmark reports. The changes ensure more reliable fixture creation, a more organized testing workflow, and clearer presentation of performance metrics, ultimately contributing to a more robust and maintainable benchmarking system. Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces a new throughput dashboard script, switches the test fixture generator from openpyxl to xlsxwriter for better compatibility, and adds new bulk read performance scenarios. The changes are well-implemented, particularly the switch to xlsxwriter which is applied consistently across all fixture generation functions. I have a couple of suggestions to improve maintainability by reducing code duplication in the fixture generator and improving type safety in the new dashboard script. Overall, this is a solid contribution that improves the performance testing capabilities of the project.
| path.parent.mkdir(parents=True, exist_ok=True) | ||
| wb.save(path) | ||
| wb = xlsxwriter.Workbook(str(path)) | ||
| try: | ||
| ws = wb.add_worksheet(sheet) | ||
| value = start | ||
| for r in range(rows): | ||
| for c in range(cols): | ||
| ws.write_number(r, c, value) | ||
| value += step | ||
| finally: | ||
| wb.close() |
There was a problem hiding this comment.
This pattern of creating a directory, initializing an xlsxwriter.Workbook, and using a try...finally block to ensure it's closed is repeated in all of the _generate_*_grid functions.
To reduce code duplication and improve maintainability, consider abstracting this common logic into a context manager. This would make the generator functions cleaner and less error-prone.
| adapters = list(job["adapters"]) # type: ignore[arg-type] | ||
| features = list(job["features"]) # type: ignore[arg-type] |
There was a problem hiding this comment.
These type: ignore comments can be avoided by defining a more specific type for the job dictionaries. Using a TypedDict would provide better type safety and improve code clarity.
You could define it near the top of the file:
from typing import TypedDict
class Job(TypedDict):
name: str
adapters: list[str]
features: list[str]Then, the jobs list can be typed as list[Job], which would allow the type checker to understand the structure of each job and eliminate the need for these ignores.
Additional Comments (1)
Prompt To Fix With AIThis is a comment left during a code review.
Path: scripts/generate_throughput_fixtures.py
Line: 711:711
Comment:
manifest still says "openpyxl-generated" but fixtures now use `xlsxwriter`
```suggestion
excel_version="xlsxwriter-generated",
```
How can I resolve this? If you propose a fix, please make it concise. |
There was a problem hiding this comment.
Pull request overview
Adds a standardized “throughput dashboard” workflow and improves fixture compatibility by switching throughput fixture generation to xlsxwriter, plus expands/organizes throughput scenarios and output formatting.
Changes:
- Switch throughput fixture generation from
openpyxltoxlsxwriterand add formulas bulk-read scenarios. - Add
scripts/run_throughput_dashboard.pyto generate fixtures and run 3 consistent perf batches (bulk read/write, per-cell). - Improve throughput markdown rendering by grouping scenarios (Bulk Read / Bulk Write / Per-Cell) and harden p50 float parsing.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/excelbench/perf/renderer.py | Groups throughput tables by scenario type and improves p50 parsing. |
| scripts/run_throughput_dashboard.py | New orchestration script for fixture generation + standardized perf batches. |
| scripts/generate_throughput_fixtures.py | Uses xlsxwriter for generating throughput fixtures; adds formulas bulk-read scenarios; updates alignment/border generation. |
| fixtures/throughput_xlsx/README.md | Documents xlsxwriter rationale and new dashboard run commands/scenarios. |
| docs/trackers/performance-benchmarks.md | Updates performance tracker entries for the new scenarios/dashboard. |
| docs/trackers/performance-benchmark-runs.md | Records example dashboard/formulas bulk-read runs and outputs. |
| docs/plans/2026-02-08-performance-benchmarks.md | Adds recommended dashboard command + fixture generation note. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
|
||
| bulk_read = [f for f in workload_features if f.endswith("_bulk_read")] | ||
| bulk_write = [f for f in workload_features if f.endswith("_bulk_write")] | ||
| per_cell = [f for f in workload_features if f not in set(bulk_read + bulk_write)] |
There was a problem hiding this comment.
set(bulk_read + bulk_write) is created inside the per_cell list comprehension, so it gets rebuilt once per feature. Compute the set once (e.g., bulk_feats = set(...)) and reference it in the comprehension to avoid unnecessary work and improve readability.
| per_cell = [f for f in workload_features if f not in set(bulk_read + bulk_write)] | |
| bulk_feats = set(bulk_read + bulk_write) | |
| per_cell = [f for f in workload_features if f not in bulk_feats] |
- Extract repeated xlsxwriter mkdir/try/finally into _xlsx_workbook context manager (Gemini) - Use TypedDict for dashboard job dicts, removing type: ignore (Gemini) - Pre-compute bulk_feats set outside list comprehension (Copilot) - Fix stale excel_version "openpyxl-generated" → "xlsxwriter-generated" in manifest (Greptile) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Summary
xl/workbook.xmlscripts/run_throughput_dashboard.py— orchestrates fixture generation + 3 perf batches (bulk read, bulk write, per-cell) with consistent adapter setsformulas_*_bulk_readscenarios to throughput workloads_fmt_p50_units_per_secfor edge casesTest plan
uv run python scripts/generate_throughput_fixtures.py— fixtures generate without errorsuv run python scripts/run_throughput_dashboard.py --warmup 0 --iters 1— all 3 batches completeuv run pytest tests/ -x -q— no regressions🤖 Generated with Claude Code
Greptile Overview
Greptile Summary
This PR migrates throughput fixture generation from openpyxl to xlsxwriter to resolve pylightxl compatibility issues, adds a dashboard orchestration script for running standardized performance batches, and improves the performance renderer to group throughput results by operation type.
Key Changes:
xl/workbook.xmlthat caused pylightxl read failuresscripts/run_throughput_dashboard.pyorchestration script that generates fixtures and runs 3 perf batches (bulk read, bulk write, per-cell) with consistent adapter setsformulas_*_bulk_readscenarios to throughput workloads_fmt_p50_units_per_secfor edge cases wherep50might not be immediately convertible to floatIssues Found:
excel_versionfield still says "openpyxl-generated" but should say "xlsxwriter-generated" for consistencyConfidence Score: 4/5
scripts/generate_throughput_fixtures.pyline 711 where the metadata should be updated from "openpyxl-generated" to "xlsxwriter-generated"Important Files Changed
Sequence Diagram
sequenceDiagram participant User participant Dashboard as run_throughput_dashboard.py participant Generator as generate_throughput_fixtures.py participant xlsxwriter participant ExcelBench as excelbench perf participant Renderer as renderer.py User->>Dashboard: uv run python scripts/run_throughput_dashboard.py Dashboard->>Generator: Execute fixture generation script Generator->>xlsxwriter: Create workbooks with xlsxwriter API Note over Generator,xlsxwriter: Switch from openpyxl to fix pylightxl<br/>namespace parsing issues xlsxwriter-->>Generator: Generate .xlsx fixtures Generator->>Generator: Write manifest.json Generator-->>Dashboard: Fixtures ready Dashboard->>Dashboard: Validate manifest paths Note over Dashboard: Check for feature/path mismatches<br/>(formulas vs cell_values) Dashboard->>ExcelBench: Run bulk_read_multi batch Note over ExcelBench: Adapters: openpyxl, pandas, polars, tablib<br/>Features: cell_values + formulas bulk_read ExcelBench->>Renderer: Render performance results Renderer->>Renderer: Group scenarios (Bulk Read section) Renderer-->>Dashboard: Output to results_dev_perf_dashboard/bulk_read_multi Dashboard->>ExcelBench: Run bulk_write_multi batch Note over ExcelBench: Adapters: xlsxwriter, openpyxl, pandas, tablib<br/>Features: cell_values bulk_write ExcelBench->>Renderer: Render performance results Renderer->>Renderer: Group scenarios (Bulk Write section) Renderer-->>Dashboard: Output to results_dev_perf_dashboard/bulk_write_multi Dashboard->>ExcelBench: Run per_cell_fast batch Note over ExcelBench: Adapters: openpyxl, xlsxwriter, pylightxl, pyexcel<br/>Features: cell_values, formulas, styles ExcelBench->>Renderer: Render performance results Renderer->>Renderer: Group scenarios (Per-Cell section) Renderer-->>Dashboard: Output to results_dev_perf_dashboard/per_cell_fast Dashboard-->>User: Dashboard complete