Skip to content

Commit 71d0a9d

Browse files
committed
docs: update benchmarks with in-place FK/Jacobian results (3x faster than Pinocchio)
1 parent d89b4b8 commit 71d0a9d

1 file changed

Lines changed: 16 additions & 18 deletions

File tree

docs/src/man/benchmarks.md

Lines changed: 16 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,20 @@ This page compares the performance of ModernRoboticsBook.jl against [Pinocchio](
44

55
## Results
66

7-
| Function | ModernRoboticsBook.jl | Pinocchio 3.9 (C++) | Ratio |
8-
|----------|----------------------:|--------------------:|------:|
9-
| Forward kinematics | 0.40 μs | 0.86 μs | **0.5x (faster)** |
10-
| Jacobian | 0.45 μs | 1.0 μs | **0.5x (faster)** |
11-
| Inverse dynamics | 3.64 μs | 0.64 μs | ~6x |
12-
| Mass matrix | 22.0 μs | 0.65 μs | ~34x |
13-
| Gravity forces | 3.68 μs | 0.48 μs | ~8x |
14-
| Forward dynamics | 34.0 μs | 2.82 μs | ~12x |
7+
| Function | ModernRoboticsBook.jl | In-place (`!`) | Pinocchio 3.9 (C++) | Ratio (in-place) |
8+
|----------|----------------------:|---------------:|--------------------:|------------------:|
9+
| Forward kinematics | 0.31 μs | **0.30 μs** | 0.86 μs | **0.35x (faster)** |
10+
| Jacobian | 0.39 μs | **0.36 μs** | 1.0 μs | **0.36x (faster)** |
11+
| Inverse dynamics | 3.68 μs | | 0.64 μs | ~6x |
12+
| Mass matrix | 22.2 μs | | 0.65 μs | ~34x |
13+
| Gravity forces | 3.73 μs | | 0.48 μs | ~8x |
14+
| Forward dynamics | 34.2 μs | | 2.82 μs | ~12x |
1515

1616
*Measured on Apple M2 (16 GB), Julia 1.12, Python 3.13. Julia timings are median values from BenchmarkTools.jl.*
1717

1818
## Analysis
1919

20-
Forward kinematics and Jacobian computation are **faster than Pinocchio** thanks to Julia's StaticArrays, which eliminate heap allocations for small fixed-size matrices (4×4, 6×6).
20+
Forward kinematics and Jacobian computation are **~3x faster than Pinocchio** thanks to Julia's StaticArrays, which eliminate heap allocations for small fixed-size matrices (4×4, 6×6). The in-place variants (`forward_kinematics_space!`, `jacobian_space!`, etc.) achieve **zero allocations**.
2121

2222
The remaining gap in dynamics functions comes from algorithmic differences:
2323

@@ -28,15 +28,13 @@ The remaining gap in dynamics functions comes from algorithmic differences:
2828

2929
### Allocations
3030

31-
With StaticArrays, allocations are dramatically reduced compared to the initial implementation:
32-
33-
| Function | Allocations | Memory |
34-
|----------|------------:|-------:|
35-
| Forward kinematics | 2 | 208 B |
36-
| Jacobian | 2 | 384 B |
37-
| Inverse dynamics | 186 | 13.4 KiB |
38-
| Mass matrix | 1,114 | 80.7 KiB |
39-
| Forward dynamics | 1,702 | 125.6 KiB |
31+
| Function | Allocations | Memory | In-place |
32+
|----------|------------:|-------:|---------:|
33+
| Forward kinematics | 2 | 208 B | **0 (0 B)** |
34+
| Jacobian | 2 | 384 B | **0 (0 B)** |
35+
| Inverse dynamics | 186 | 13.4 KiB ||
36+
| Mass matrix | 1,114 | 80.7 KiB ||
37+
| Forward dynamics | 1,702 | 125.6 KiB ||
4038

4139
### When does this matter?
4240

0 commit comments

Comments
 (0)