Skip to main content

Crate oxigeo_bench

Crate oxigeo_bench 

Source
Expand description

OxiGeo Benchmarking and Profiling Suite

oxigeo-bench provides comprehensive performance profiling and benchmarking capabilities for the OxiGeo geospatial library ecosystem.

§Features

  • CPU Profiling: Profile CPU usage with flamegraph generation
  • Memory Profiling: Track memory usage and detect leaks
  • Benchmark Scenarios: Predefined scenarios for common operations
  • Performance Comparison: Compare performance across implementations
  • Regression Detection: Detect performance regressions against baselines
  • Report Generation: Generate HTML, JSON, CSV, and Markdown reports

§Example

use oxigeo_bench::scenarios::{ScenarioBuilder, ScenarioRunner};
use oxigeo_bench::report::{BenchmarkReport, ReportFormat};

// Create a custom benchmark scenario
let scenario = ScenarioBuilder::new("my_benchmark")
    .description("Test raster processing")
    .execute(|| {
        // Your benchmark code here
        Ok(())
    })
    .build();

// Run the scenario
let mut runner = ScenarioRunner::new();
runner.add_scenario(scenario);
runner.run_all().expect("Failed to run benchmarks");

// Generate a report
let mut report = BenchmarkReport::new("My Benchmark Report");
report.add_scenario_results(runner.results().to_vec());
report.generate("report.html", ReportFormat::Html)
    .expect("Failed to generate report");

§Scenario Modules

  • scenarios::raster: Raster operation benchmarks (requires raster feature)
  • scenarios::vector: Vector operation benchmarks (requires vector feature)
  • scenarios::io: I/O performance benchmarks
  • scenarios::cloud: Cloud storage benchmarks (requires cloud feature)
  • scenarios::ml: ML inference benchmarks (requires ml feature)

§Profiling

The profiler module provides memory-usage profiling utilities (profiler::MemoryProfiler, profiler::SystemMonitor) unconditionally. CPU/flamegraph profiling (profiler::CpuProfiler, profiler::profile_cpu) additionally requires the non-default profiling feature, since it pulls in pprof -> backtrace -> miniz_oxide (kept out of the default build graph by the Pure Rust Policy):

ⓘ
// Requires: cargo build --features profiling
use oxigeo_bench::profiler::{profile_cpu, CpuProfilerConfig};

let config = CpuProfilerConfig {
    frequency: 100,
    generate_flamegraph: true,
    ..Default::default()
};

let (result, report) = profile_cpu(|| {
    // Code to profile
    42
}, config).expect("Profiling failed");

println!("Profiling duration: {:?}", report.duration);

Re-exports§

pub use error::BenchError;
pub use error::Result;

Modules§

comparison
Cross-implementation comparison utilities.
error
Error types for benchmarking operations.
ml_fixtures
Minimal, self-contained ONNX model fixtures for the ml benchmark suite.
prelude
Prelude module with commonly used types and traits.
profiler
Profiling utilities for CPU and memory profiling.
regression
Performance regression detection.
report
Benchmark report generation.
scenarios
Benchmark scenarios for various oxigeo operations.

Constants§

CRATE_NAME
The name of this crate.
VERSION
The version of this crate.