oxigdal-bench
Comprehensive performance profiling and benchmarking suite for the OxiGDAL geospatial library ecosystem.
Features
- CPU Profiling: Profile CPU usage with automatic flamegraph generation using
pprof - Memory Profiling: Track memory usage over time and detect memory leaks
- System Monitoring: Monitor system resources (CPU, memory, processes) during benchmarks
- Benchmark Scenarios: Predefined scenarios for common geospatial operations
- Performance Comparison: Compare performance across different implementations
- Regression Detection: Automatically detect performance regressions against baseline
- Multi-format Reports: Generate HTML, JSON, CSV, and Markdown reports
- CI/CD Integration: Easy integration with continuous integration pipelines
Installation
Add this to your Cargo.toml:
[]
= "0.1.3"
Quick Start
Basic Benchmarking
use *;
// Create a custom benchmark scenario
let scenario = new
.description
.execute
.build;
// Run the scenario
let mut runner = new;
runner.add_scenario;
runner.run_all?;
// Generate a report
let mut report = new;
report.add_scenario_results;
report.generate?;
CPU Profiling
use ;
let config = CpuProfilerConfig ;
let = profile_cpu?;
println!;
if let Some = report.flamegraph_path
Memory Profiling
use ;
let mut profiler = new;
profiler.start?;
// Run your code
profiler.stop?;
let report = profiler.stop?;
println!;
println!;
// Save detailed report
report.save_json?;
Regression Detection
use ;
let config = RegressionConfig ;
let mut detector = new?;
// Run benchmarks
let mut runner = new;
// ... add scenarios ...
runner.run_all?;
// Detect regressions
let regressions = detector.detect;
// Generate regression report
let report = new;
if report.has_regressions
// Update baselines (if no regressions)
if !report.has_regressions
Feature Flags
raster: Enable raster operation benchmarks (requiresoxigdal-geotiff)vector: Enable vector operation benchmarks (requiresoxigdal-geojson)cloud: Enable cloud storage benchmarks (requiresoxigdal-cloud)ml: Enable ML inference benchmarks (requiresoxigdal-ml)analytics: Enable analytics benchmarks (requiresoxigdal-analytics)full: Enable all features
[]
= { = "0.1.3", = ["raster", "vector"] }
Benchmark Scenarios
Raster Operations
use *;
// GeoTIFF reading
let scenario = new
.with_tile_size;
// Compression comparison
let scenario = new
.with_methods;
Vector Operations
use *;
// Geometry simplification
let scenario = new
.with_algorithm;
// Spatial indexing
let scenario = new
.with_index_type
.with_query_count;
I/O Performance
use *;
// Sequential read/write
let scenario = new
.with_buffer_size;
// Random access patterns
let scenario = new
.with_chunk_size;
Criterion Integration
Run benchmarks with Criterion:
Available benchmark suites:
raster_ops: Raster operation benchmarksvector_ops: Vector operation benchmarksio_ops: I/O performance benchmarkscloud_ops: Cloud storage benchmarksml_inference: ML inference benchmarks
Report Generation
HTML Report
report.generate?;
JSON Report
report.generate?;
CSV Report
report.generate?;
Markdown Report
report.generate?;
Performance Comparison
use *;
let mut comparison = new;
comparison.set_baseline;
// Add results from different implementations
comparison.add_result;
comparison.add_result;
// Calculate speedup
if let Some = comparison.speedup
// Generate comparison report
let suite = new;
suite.add_comparison;
let report = new;
println!;
CI/CD Integration
GitHub Actions
name: Benchmark
on:
jobs:
benchmark:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- name: Run benchmarks
run: cargo bench --features full
- name: Upload results
uses: actions/upload-artifact@v3
with:
name: benchmark-results
path: target/criterion
License
Licensed under the Apache License, Version 2.0.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for details.
Copyright
Copyright (c) 2025 COOLJAPAN OU (Team Kitasan)