Skip to content

feat: add reproducible JavaScript and Rust benchmark suites - #117

Merged
konard merged 12 commits into
mainfrom
issue-29-55357638
Sep 15, 2026
Merged

konard merged 12 commits into
mainfrom
issue-29-55357638

Conversation

@konard

@konard konard commented Sep 9, 2025

Copy link
Copy Markdown
Member

Summary

  • replace the obsolete benchmark draft with reproducible JavaScript and Rust benchmark playgrounds
  • run each implementation and its ecosystem competitors through equivalent validated fixtures for performance, feature coverage, package footprint, and real-world workloads
  • emit machine-readable JSON and standalone HTML reports, plus informational base/head regression comparisons for pull requests
  • run JavaScript and Rust benchmark smoke profiles in CI and full profiles on main, weekly, and on demand
  • enforce source and benchmark parity independently in CI, so a change to one supported language requires its counterpart or an explicit parity-exempt label
  • audit both production and benchmark Rust lockfiles and document the methodology, limitations, focused CLI, and migration entry points

Problem and reproduction

The former JavaScript suite was rooted outside the package after the monorepo migration. Running bun benchmarks/run-all-benchmarks.mjs failed while importing the deleted root src tree. It also estimated some results, simulated competitor workloads, swallowed failed measurements, and was not exercised by active CI. Rust had no corresponding competitor benchmark suite.

The replacements pin competitors, validate warmups and measured outputs, rotate adapter order, record runtime/package versions, and keep timing regressions informational because shared CI hosts are noisy.

Run the smoke profiles locally:

cd js
bun install --frozen-lockfile
bun run benchmark:smoke

cd ../rust
cargo run --release --locked --manifest-path benchmarks/Cargo.toml -- --smoke

Verification

  • JavaScript full suite: 1,445 passed, 6 intentional skips, 0 failed
  • JavaScript benchmark infrastructure: 13 passed
  • JavaScript smoke benchmark: all categories and report generation passed
  • Rust production checks: format, Clippy, docs, unit/integration tests, and doc tests passed
  • Rust benchmark package: check, Clippy, 8 tests (including 7 integration tests), release smoke profile, report generation, and base/head comparison passed
  • language parity tests: 6 passed, covering one-sided source and benchmark changes plus valid paired changes
  • repository/workflow hygiene: 163 passed; actionlint passed
  • RustSec: production and benchmark lockfiles passed
  • package verification confirmed rust/benchmarks is excluded from the published command-stream crate
  • final GitHub matrix: 32 passed, 6 intentional skips, 0 failed

The generated JavaScript and Rust reports are uploaded as workflow artifacts. Pull requests use small smoke/base-head profiles; main, weekly, and manual runs use the full profile.

Fixes #29

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #29
@konard konard self-assigned this Sep 9, 2025
konard and others added 2 commits September 9, 2025 21:44
Implements a complete benchmarking solution comparing command-stream against:
- execa (98M+ downloads)
- cross-spawn (409M+ downloads)
- ShellJS (35M+ downloads)
- zx (4.2M+ downloads)
- Bun.$ (built-in)

## Features Added:

### 📦 Bundle Size Analysis
- Compare installed sizes and gzipped estimates
- Dependency footprint analysis
- Memory usage tracking

### ⚡ Performance Benchmarks
- Process spawning speed tests
- Streaming vs buffering throughput
- Pipeline performance comparison
- Concurrent execution scaling
- Error handling performance

### 🧪 Feature Completeness Tests
- Template literal support validation
- Real-time streaming capabilities
- Async iteration compatibility
- EventEmitter pattern support
- Built-in commands availability
- Pipeline support verification

### 🌍 Real-World Use Cases
- CI/CD pipeline simulation
- Log processing benchmarks
- File operations testing
- Development workflow optimization

### 📊 Reporting & Visualization
- Comprehensive HTML reports
- Interactive performance charts
- Feature compatibility matrix
- JSON data export
- Quick demo script

## Package Updates:
- Version bump to 0.8.0 for new benchmarking capabilities
- Added benchmark npm scripts:
  - `npm run benchmark` - Full comprehensive suite
  - `npm run benchmark:quick` - Fast subset
  - `npm run benchmark:demo` - Quick demonstration

## Usage:
```bash
npm run benchmark         # Complete suite (~5-10 minutes)
npm run benchmark:demo    # Quick demo (~30 seconds)
npm run benchmark:quick   # Essential benchmarks only
```

Reports generated in `benchmarks/results/` with HTML visualizations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Comprehensive benchmarking suite against all major competitors Add comprehensive benchmarking suite against all major competitors Sep 9, 2025
@konard
konard marked this pull request as ready for review September 9, 2025 18:56
Includes:
- CI-INTEGRATION.md with setup instructions
- benchmarks.yml workflow template for manual installation
- Explains OAuth permission requirements for workflow files

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

We should add full benchmarks and tests suite, to exceed all competitors in features, performance and so on. Yet keep the most intuitive and simple API contract possible.

@konard
konard marked this pull request as draft September 15, 2026 18:47
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-09-15T18:47:30.532Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

Runtime: solve v2.29.0 · tool codex · model gpt-5.6-sol · task image konard/hive-mind-dind:2.29.0@sha256:11a236d03854cbaea86fdd7ca06265c912cf0b67d1fcc9b3eb60bd84c43ff749

@konard konard changed the title Add comprehensive benchmarking suite against all major competitors feat(js): add reproducible competitor benchmark suite Sep 15, 2026
@konard
konard marked this pull request as ready for review September 15, 2026 19:44
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented and pushed the comprehensive benchmark suite. PR #117 is ready for review, mergeable, and based on current main.

Highlights:

  • Real benchmarks for command-stream, Execa, cross-spawn, ShellJS, zx, and Bun Shell.
  • Performance, bundle size, memory, feature coverage, pipelines, and deterministic real-world suites.
  • JSON and interactive HTML reports with CI base/head comparisons.
  • Documentation and migration guidance.
  • Fixed zx Windows path handling after CI exposed exit code 127 ([preserved log](/ci-logs/javascript-checks-35014410535-windows.log:638)).

Verification:

  • Focused tests: 12 passed, 50 expectations.
  • Full JS suite: 1,432 passed, 6 intentional skips.
  • Full benchmark: 11 scenarios, 54 validated measurements.
  • Final CI: 31 successful checks, 6 intentional skips, zero failures.
Rest of the working session summary (41 characters)
- Working tree clean; PR head: `19ca271`.

This summary was automatically extracted from the AI working session output.

@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $24.569521

📊 Context and tokens usage:

  • 580.5K / 200K (290%) input tokens, 89.4K / 128K (70%) output tokens

Total: (580.5K + 21.6M cached) input tokens, 89.4K output tokens, $24.569521 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (6942KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

✅ Ready to merge

This pull request is now ready to be merged:

  • All CI checks have passed
  • No merge conflicts
  • No pending changes

Monitored by hive-mind with --auto-restart-until-mergeable flag

@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

We should support all programming languages equally, and make sure this parity is guaranteed by CI/CD, so it is not possible to change JavaScript code without changing Rust code and vice versa.

@konard
konard marked this pull request as draft September 15, 2026 20:21
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-09-15T20:21:58.454Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

Runtime: solve v2.29.0 · tool codex · model gpt-5.6-sol · task image konard/hive-mind-dind:2.29.0@sha256:11a236d03854cbaea86fdd7ca06265c912cf0b67d1fcc9b3eb60bd84c43ff749

@konard konard changed the title feat(js): add reproducible competitor benchmark suite feat: add reproducible JavaScript and Rust benchmark suites Sep 15, 2026
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

Addressed in commits a174407, b857630, and ad3aa69: Rust now has an equivalent competitor benchmark playground and CI job, source and benchmark parity are enforced independently in both directions, and both Rust lockfiles are audited. The PR description now documents the two-language scope and verification.

@konard
konard marked this pull request as ready for review September 15, 2026 21:26
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-5.6 Sol
  • Provider: OpenAI
  • Public pricing estimate: $27.912957

📊 Context and tokens usage:

  • 628.8K / 200K (314%) input tokens, 88.7K / 128K (69%) output tokens

Total: (628.8K + 25.3M cached) input tokens, 88.7K output tokens, $27.912957 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.6-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-5.6 Sol (gpt-5.6-sol)

📎 Log file uploaded as Gist (8160KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit 6bb7382 into main Sep 15, 2026
38 checks passed
@konard

konard commented Sep 15, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

Comprehensive benchmarking suite against all major competitors

1 participant