Skip to content

feat(perf): throughput dashboard + xlsxwriter fixture compat - #8

Merged
wolfiesch merged 1 commit into
masterfrom
feat/throughput-dashboard-xlsxwriter-compat
Feb 9, 2026
Merged

feat(perf): throughput dashboard + xlsxwriter fixture compat#8
wolfiesch merged 1 commit into
masterfrom
feat/throughput-dashboard-xlsxwriter-compat

Conversation

@wolfiesch

@wolfiesch wolfiesch commented Feb 9, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Switch fixture generator from openpyxl to xlsxwriter to fix pylightxl read failures caused by namespace placement in xl/workbook.xml
  • Add scripts/run_throughput_dashboard.py — orchestrates fixture generation + 3 perf batches (bulk read, bulk write, per-cell) with consistent adapter sets
  • Add formulas_*_bulk_read scenarios to throughput workloads
  • Group renderer output into Bulk Read / Bulk Write / Per-Cell sections for readability
  • Fix float parsing in _fmt_p50_units_per_sec for edge cases

Test plan

  • Run uv run python scripts/generate_throughput_fixtures.py — fixtures generate without errors
  • Run uv run python scripts/run_throughput_dashboard.py --warmup 0 --iters 1 — all 3 batches complete
  • Verify pylightxl can read the xlsxwriter-generated fixtures (was failing on openpyxl-generated ones)
  • Run uv 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:

  • Switched fixture generator from openpyxl to xlsxwriter to fix namespace placement in xl/workbook.xml that caused pylightxl read failures
  • Added scripts/run_throughput_dashboard.py orchestration script that generates fixtures and runs 3 perf batches (bulk read, bulk write, per-cell) with consistent adapter sets
  • Added formulas_*_bulk_read scenarios to throughput workloads
  • Improved renderer output by grouping throughput tables into Bulk Read / Bulk Write / Per-Cell sections for better readability
  • Fixed float parsing in _fmt_p50_units_per_sec for edge cases where p50 might not be immediately convertible to float

Issues Found:

  • Minor: The manifest excel_version field still says "openpyxl-generated" but should say "xlsxwriter-generated" for consistency

Confidence Score: 4/5

  • This PR is safe to merge with one minor metadata inconsistency that should be fixed
  • The implementation is solid with proper error handling (try-finally blocks for workbook closing), validation logic in the dashboard script, and defensive float parsing in the renderer. The xlsxwriter migration is thorough and consistent across all generation functions. The only issue is a minor metadata inconsistency where the manifest still references "openpyxl-generated" instead of "xlsxwriter-generated"
  • Pay attention to scripts/generate_throughput_fixtures.py line 711 where the metadata should be updated from "openpyxl-generated" to "xlsxwriter-generated"

Important Files Changed

Filename Overview
scripts/generate_throughput_fixtures.py Migration from openpyxl to xlsxwriter for fixture generation; minor metadata inconsistency with excel_version field
scripts/run_throughput_dashboard.py New orchestration script for running throughput benchmarks; includes validation for manifest and feature-path consistency
src/excelbench/perf/renderer.py Improved throughput table organization with Bulk Read/Write/Per-Cell grouping; fixed float parsing edge cases in rate calculations

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
Loading

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>
Copilot AI review requested due to automatic review settings February 9, 2026 02:23
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @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

  • Fixture Generator Switch: The fixture generator has been switched from openpyxl to xlsxwriter to resolve pylightxl read failures caused by namespace placement issues in xl/workbook.xml.
  • New Throughput Dashboard Script: A new script, scripts/run_throughput_dashboard.py, has been added to orchestrate fixture generation and execute three distinct performance batches: bulk read, bulk write, and per-cell, using consistent adapter sets.
  • New Formula Scenarios: New formulas_*_bulk_read scenarios have been introduced to the throughput workloads, expanding the scope of performance testing for formula handling.
  • Improved Renderer Output Grouping: The performance renderer output is now grouped into 'Bulk Read', 'Bulk Write', and 'Per-Cell' sections, significantly enhancing readability and organization of benchmark results.
  • Float Parsing Fix: A fix has been implemented in _fmt_p50_units_per_sec to correctly handle float parsing for edge cases, improving the robustness of performance metric calculations.
  • Documentation Updates: Documentation has been updated to reflect the new dashboard script, the switch to xlsxwriter for fixture generation, and new performance benchmark run entries.

🧠 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
  • docs/plans/2026-02-08-performance-benchmarks.md
    • Added instructions for running the new run_throughput_dashboard.py script.
    • Included an implementation note about using xlsxwriter for fixture generation to resolve pylightxl parsing issues.
  • docs/trackers/performance-benchmark-runs.md
    • Added new performance benchmark run entries, including one for bulk formulas read scenarios and another for the throughput dashboard run.
  • docs/trackers/performance-benchmarks.md
    • Added new entries detailing work on bulk formulas read scenarios, report readability improvements (grouping tables), and the dashboard/fixture compatibility.
  • fixtures/throughput_xlsx/README.md
    • Added an implementation note explaining the switch to xlsxwriter for fixture generation.
    • Included instructions for running the standard dashboard batches and an option to include slow per-cell readers.
    • Updated the list of generated scenarios to include formulas_1k_bulk_read and formulas_10k_bulk_read.
  • scripts/generate_throughput_fixtures.py
    • Replaced openpyxl with xlsxwriter for generating .xlsx fixtures.
    • Updated several _generate_*_grid functions to use xlsxwriter's API for writing data and applying styles.
    • Added formulas_10k_bulk_read and formulas_1k_bulk_read test cases.
  • scripts/run_throughput_dashboard.py
    • Added a new script to orchestrate the generation of throughput fixtures and the execution of multiple performance benchmark batches (bulk read, bulk write, per-cell fast, and optionally per-cell slow).
    • Implemented argument parsing for test directory, output root, warmup/iterations, breakdown, and options to include slow readers or 100k cell generation.
    • Included manifest validation to ensure fixture paths and features are correctly mapped.
  • src/excelbench/perf/renderer.py
    • Modified _append_throughput_section to group throughput tables into 'Bulk Read', 'Bulk Write', and 'Per-Cell' sections for improved readability.
    • Refactored the table appending logic into a new _append_throughput_table helper function.
    • Fixed _fmt_p50_units_per_sec to handle p50 values that might be None or 0 more robustly, preventing TypeError or ZeroDivisionError.
Activity
  • This pull request was generated by Claude Code, an AI assistant.
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment on lines 40 to +50
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()

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Comment on lines +147 to +148
adapters = list(job["adapters"]) # type: ignore[arg-type]
features = list(job["features"]) # type: ignore[arg-type]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@greptile-apps greptile-apps Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

@greptile-apps

greptile-apps Bot commented Feb 9, 2026

Copy link
Copy Markdown
Contributor
Additional Comments (1)

scripts/generate_throughput_fixtures.py
manifest still says "openpyxl-generated" but fixtures now use xlsxwriter

        excel_version="xlsxwriter-generated",
Prompt To Fix With AI
This 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 openpyxl to xlsxwriter and add formulas bulk-read scenarios.
  • Add scripts/run_throughput_dashboard.py to 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)]

Copilot AI Feb 9, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
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]

Copilot uses AI. Check for mistakes.
@wolfiesch
wolfiesch merged commit 9b71b33 into master Feb 9, 2026
10 of 11 checks passed
wolfiesch added a commit that referenced this pull request Feb 9, 2026
- 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants