Skip to main content

Crate oxigdal_bench

Crate oxigdal_bench 

Source
Expand description

OxiGDAL Benchmarking and Profiling Suite

oxigdal-bench provides comprehensive performance profiling and benchmarking capabilities for the OxiGDAL 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 oxigdal_bench::profiler::{CpuProfiler, CpuProfilerConfig};
use oxigdal_bench::scenarios::{ScenarioBuilder, ScenarioRunner};
use oxigdal_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 CPU and memory profiling utilities:

use oxigdal_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.
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 oxigdal operations.

Constants§

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