kornia/kornia-rs
View on GitHub[Feature]: Add Benchmarks for kornia-algebra Optimization and Lie Group Modules
Open
#698 opened on Feb 8, 2026
enhancementhelp wantedtriage
Repository metrics
- Stars
- (675 stars)
- PR merge metrics
- (PR metrics pending)
Description
🚀 Feature Description
This feature request proposes the implementation of a comprehensive benchmarking suite for the kornia-algebra crate. Specifically, it targets the newly introduced optimization module (optim) and expands the existing Lie Group benchmarks to provide comparative performance metrics against established libraries like nalgebra and sophus.
📂 Feature Category
Rust Core Library
💡 Motivation
- Performance Tracking: Currently, there are limited benchmarks for the optimization engine. As the library grows, it is crucial to track performance regressions.
- Comparative Analysis: To ensure
kornia-rsremains a high-performance choice for computer vision in Rust, we need to baseline its geometric operations against standard ecosystems like nalgebra andsophus. - Optimization Validation: Developers need a way to quantitatively verify that changes to the solver (e.g., different linear system solvers, trust-region strategies) actually improve runtime performance.
💭 Proposed Solution
I propose adding the following benchmark files and updates:
- bench_optim.rs:
- Implement the Rosenbrock Function as a Factor trait.
- Use this function to benchmark the convergence speed and iteration time of the LevenbergMarquardt solver.
- Compare execution time for fixed iteration counts.
- bench_lie_group.rs:
- Add
sophusas adev-dependencyto facilitate direct comparison. - Implement side-by-side benchmarks for:
SO3::expandSO3::log.SE3composition (multiplication) and inversion.- Compare
kornia-algebravs nalgebra vssophus.
- Add
- bench_linalg.rs:
- Clean up existing benchmarks to ensure fair comparisons (e.g., removing redundant allocations or iterator conversions).
📚 Library Reference
The implementation will reference the following libraries and concepts:
- Nalgebra: The standard linear algebra library in Rust for geometric types (
Isometry3,UnitQuaternion). - Sophus: A C++ (and Rust) Lie Group library often used as a gold standard in robotics.
- Rosenbrock Function: A non-convex function used as a performance test problem for optimization algorithms.
🔄 Alternatives Considered
No response
🎯 Use Cases
- CI Regression Testing: Running
cargo benchin CI to detect performance drops in PRs. - Solver Development: When a developer implements a new
LinearSolver(e.g., sparse Cholesky), they can usebench_optimto prove its speedup on non-trivial problems. - End-User Confidence: Users evaluating
kornia-rsfor real-time SLAM systems can see transparent performance comparisons against libraries they already know.
📝 Additional Context
No response
🤝 Contribution Intent
- I plan to submit a PR to implement this feature
- I'm requesting this feature but not planning to implement it