Skip to content

Add Rust ecosystem comparison benchmark suite#44

Merged
Nebu1eto merged 5 commits into
mainfrom
claude/rust-excel-benchmarks-2NtPg
Feb 11, 2026
Merged

Add Rust ecosystem comparison benchmark suite#44
Nebu1eto merged 5 commits into
mainfrom
claude/rust-excel-benchmarks-2NtPg

Conversation

@Nebu1eto

Copy link
Copy Markdown
Owner

Summary

Adds a comprehensive benchmark suite that compares SheetKit against other popular Rust Excel libraries (calamine, rust_xlsxwriter, and edit-xlsx) across multiple scenarios including read, write, and specialized operations.

Key Changes

  • New benchmark binary (benchmarks/rust-comparison/src/main.rs): A 1800+ line benchmark harness that:

    • Compares SheetKit against calamine (read-only), rust_xlsxwriter (write-only), and edit-xlsx (read/modify/write)
    • Mirrors the scenario structure of existing Node.js and Rust benchmarks for consistency
    • Implements comprehensive benchmarking infrastructure with warmup runs, multiple iterations, and statistical analysis (min, max, median, p95)
  • Benchmark scenarios:

    • Read benchmarks: File reading performance across different file sizes
    • Write benchmarks: Large data writes (50k rows × 20 cols), styled cells, multi-sheet workbooks, formulas, text-heavy data, and merged cells
    • Scaling benchmarks: Write performance at various row counts (100, 1k, 10k, 100k, 500k rows)
    • Advanced features: Buffer round-trip (write→read), streaming writes, and random-access reads
  • Performance metrics: Captures execution time (with min/max/median/p95 statistics), peak memory usage, and output file size

  • System information detection: Automatically detects and reports CPU model, RAM, and Rust compiler version for reproducible benchmarking

  • Platform support: Includes platform-specific code for macOS and Linux to measure RSS memory usage; graceful fallback for other platforms

  • Workspace integration: Added new benchmark crate to workspace members in root Cargo.toml

Implementation Details

  • Uses closure-based benchmark harness to allow flexible test setup and cleanup
  • Implements proper file cleanup between runs to avoid disk space issues
  • Supports both file-based and buffer-based operations where applicable
  • Deterministic random cell selection for random-access benchmarks using seeded PRNG
  • Comprehensive error handling with informative skip messages when fixture files are missing

https://claude.ai/code/session_012jgPjB6pTXjQpWarssU9yp

claude and others added 4 commits February 11, 2026 12:46
…sxwriter/edit-xlsx)

Introduces benchmarks/rust-comparison with scenarios mirroring the
existing Node.js benchmark suite, comparing SheetKit against:
- calamine (read-only): read benchmarks, random-access read
- rust_xlsxwriter (write-only): write benchmarks, scaling, formulas
- edit-xlsx (read/write/modify): all scenarios including modify

Covers read, write, styled write, multi-sheet, formulas, strings,
merged cells, scaling (1k-100k rows), buffer round-trip, streaming,
random-access read, and modify benchmarks.

https://claude.ai/code/session_012jgPjB6pTXjQpWarssU9yp
- Canonicalize fixture paths for consistent resolution
- Gracefully skip edit-xlsx benchmarks when it cannot open SheetKit-
  generated fixtures (incompatible xlsx structure)
- Add probe check for modify benchmark to avoid runtime panics
- Remove unused generate-fixtures binary target from Cargo.toml

https://claude.ai/code/session_012jgPjB6pTXjQpWarssU9yp
Signed-off-by: Haze Lee <hazelee@realignist.me>
@Nebu1eto
Nebu1eto force-pushed the claude/rust-excel-benchmarks-2NtPg branch from bbe41a5 to c653331 Compare February 11, 2026 04:25
@Nebu1eto
Nebu1eto marked this pull request as ready for review February 11, 2026 04:25
@claude

claude Bot commented Feb 11, 2026

Copy link
Copy Markdown

Code Review

Issue: Decorative Section Marker Comments

File: benchmarks/rust-comparison/src/main.rs

The file contains multiple decorative section marker comments using repeated dashes (// -----------) and equals signs (// ===). According to CLAUDE.md line 58, the project prohibits section markers and decorative comments:

No section markers, decorative comments, or emoji in code or output.

Examples of violations:

  1. Lines 20-22: Decorative dashes around "Helpers" section
  2. Lines 159-161: Decorative dashes around "BenchResult" section
  3. Lines 1143-1145: Decorative equals signs around "READ BENCHMARKS" section
  4. Similar patterns throughout the file (~20+ occurrences)

Suggested fix: Remove all decorative comment lines. Simple section comments without decoration are acceptable (e.g., // Helpers), but the decorative lines of dashes and equals signs should be removed.


No other issues found. Checked for bugs and CLAUDE.md compliance.

@claude

claude Bot commented Feb 11, 2026

Copy link
Copy Markdown

Code review

Issue Found: Section marker comments violate CLAUDE.md

The new benchmarks/rust-comparison/src/main.rs file contains decorative section marker comments that violate the code style guidelines.

CLAUDE.md Rule (Line 58):

No section markers, decorative comments, or emoji in code or output.

Examples found in the code:

Pattern 1 (dashed lines):

// ---------------------------------------------------------------------------
// Helpers
// ---------------------------------------------------------------------------

Pattern 2 (equals lines):

// ===================================================================
// READ BENCHMARKS: SheetKit vs calamine
// ===================================================================

Locations: These decorative section markers appear throughout benchmarks/rust-comparison/src/main.rs at lines:

  • 20-22 (Helpers)
  • 159-161 (BenchResult)
  • 204-206 (Bench harness)
  • 283-285, 378-380 (READ BENCHMARKS)
  • 1034-1036, 1163-1165 (WRITE BENCHMARKS)
  • 1224-1226 (WRITE SCALING)
  • 1298-1300 (READ SCALING)
  • 1375-1377, 1451-1453, 1722-1724 (Advanced benchmarks)
  • And several more throughout the file (24 total lines)

Recommended fix: Remove all decorative section marker comment lines. The existing benchmarks/rust/src/main.rs demonstrates organizing benchmark code without section markers - function names and spacing provide sufficient structure.

Removes 12 decorative comment blocks (dashes/equals lines) that violate
the CLAUDE.md code style rule prohibiting section markers and decorative
comments. Function names and spacing provide sufficient code structure.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Nebu1eto
Nebu1eto merged commit c808790 into main Feb 11, 2026
7 checks passed
@Nebu1eto
Nebu1eto deleted the claude/rust-excel-benchmarks-2NtPg branch February 11, 2026 07:59
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