Skip to content

Benchmark v0.7.0 - stable

Pre-release
Pre-release

Choose a tag to compare

@jamesgober jamesgober released this 30 Aug 07:23
· 14 commits to main since this release

Version 0.7.0 - 2025-08-30

A comprehensive documentation overhaul establishing Benchmark as both a development benchmarking suite and production APM tool. This release enhances clarity, adds extensive real-world examples, and positions the library for enterprise observability use cases.


✨ Features

  • Dual-purpose positioning: Clear separation between development benchmarking and production APM capabilities.
  • Comprehensive documentation: New guides for micro/macro benchmarking, comparative analysis, and distributed tracing.
  • Real-world examples: Database queries, API endpoints, cache operations, and batch processing patterns.
  • APM-ready features: Span-like timing semantics for distributed tracing compatibility.
  • Load testing patterns: Documentation for simulating realistic traffic and stress testing.

💡 Highlights

  • Benchmarking Suite docs: Complete guide covering statistical sampling, CI/CD integration, and regression detection.
  • Metrics Module docs: Production observability patterns including health checks, TTFB monitoring, and APM integration.
  • Comparative analysis: A/B testing framework for data-driven optimization decisions.
  • Distributed tracing: Each measurement as a span for breaking down complex operations.
  • Feature documentation: Dedicated docs explaining all feature combinations and use cases.
  • Criterion comparisons: Positioning as a lightweight, zero-dependency alternative.

📌 Changes

Added

  • Documentation structure: /docs/BENCHMARK.md and /docs/METRICS.md for focused guides.
  • Feature matrix docs: /docs/features/README.md explaining all combinations.
  • Real examples: Database timing, API latency tracking, middleware chain measurements.
  • Load testing patterns: Concurrent request simulation and stress testing examples.
  • APM integration guide: Using Watch/Timer as spans for observability platforms.

Changes

  • README rewrite: Clear dual-purpose positioning with development vs production contexts.
  • API examples: Replaced trivial 2+2 with realistic use cases throughout.
  • Feature descriptions: Clearer explanations of standard, minimal, and custom combinations.
  • Documentation links: Direct deep links to specific sections for better navigation.

𖢥 Bug Fixes

  • Documentation clarity: Fixed ambiguous feature flag descriptions.
  • Example consistency: All code examples now use consistent patterns and imports.
  • Link accuracy: Updated all internal documentation links to use correct paths.


Minimum Supported Rust Version (MSRV)

1.75.0


Migration Notes

  • No API changes: This is a documentation-focused release with no breaking changes.
  • New resources: Check out /docs/BENCHMARK.md for development use cases and /docs/METRICS.md for production.
  • Feature clarity: Review /docs/features/README.md if you're unsure which features to enable.

Quick Start Examples

Development Benchmarking:

use benchmark::{benchmark, Collector};

// Benchmark different implementations
let (_, baseline) = benchmark!("vec_push", 10_000, {
    let mut v = Vec::new();
    for i in 0..1000 { v.push(i); }
});

let (_, optimized) = benchmark!("vec_with_capacity", 10_000, {
    let mut v = Vec::with_capacity(1000);
    for i in 0..1000 { v.push(i); }
});

// Compare results for regression detection

Production APM:

use benchmark::{Watch, Timer, stopwatch};

let watch = Watch::new();

// Database query timing
async fn query_user(id: u64, watch: &Watch) -> User {
    let _timer = Timer::new(watch.clone(), "db.query.user");
    // ... actual query ...
}

// API endpoint monitoring
stopwatch!(watch, "api.users.get", {
    let user = query_user(id, &watch).await;
    serialize_response(user)
});

// Extract metrics for APM
let snapshot = watch.snapshot();
let p99 = snapshot["api.users.get"].percentile(0.99);

Documentation Overview

  • [Benchmark Documentation](docs/BENCHMARK.md): Statistical benchmarking for development.

    • Micro-benchmarking hot paths
    • Macro-benchmarking entire systems
    • Comparative analysis for optimizations
    • CI/CD regression detection
    • Load testing patterns
  • [Metrics Documentation](docs/METRICS.md): Production observability and APM.

    • Code instrumentation strategies
    • Distributed tracing with spans
    • Real-time performance metrics
    • Health check implementations
    • APM platform integration
  • [API Reference](docs/API.md): Complete function and macro documentation.

  • [Features Guide](docs/features/README.md): Understanding feature combinations.

  • [Principles](docs/PRINCIPLES.md): Design philosophy and contribution guidelines.


Community Recognition

This release acknowledges the growing adoption of rust-benchmark in production systems and the need for clearer positioning. The dual-purpose nature (dev benchmarking + prod APM) is now explicitly documented with appropriate examples for each use case.


Known Notes

  • Documentation assumes familiarity with basic benchmarking concepts.
  • APM examples are tool-agnostic but follow OpenTelemetry-like span semantics.
  • Load testing examples may require adjustment based on your specific workload characteristics.
  • Some linked documentation sections are planned for future expansion.


Full Changelog: v0.6.0...v0.7.0