Skip to content

Commit e3f412b

Browse files
committed
Update benchmark results
1 parent 93a5eaf commit e3f412b

File tree

3 files changed

+146
-114
lines changed

3 files changed

+146
-114
lines changed

docs/src/benchmarks.md

Lines changed: 47 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
# Benchmarks
22

3-
To attain maximal performance, it is recommended to pass `-O3`, `--check-bounds=no` as command line flags to `julia`. As of Julia 1.1, maximizing performance for the `dynamics!` algorithm requires either setting the number of BLAS threads to 1 (`using LinearAlgebra; BLAS.set_num_threads(1)`) if using OpenBLAS (the default), or compiling Julia with MKL. See [this issue](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/issues/500) for more information.
3+
To attain maximal performance, it is recommended to pass `-O3` and `--check-bounds=no` as command line flags to `julia`:
4+
5+
```bash
6+
cd RigidBodyDynamics.jl
7+
julia -O3 --check-bounds=no perf/runbenchmarks.jl
8+
```
9+
10+
> **Warning**
11+
> For Julia versions previous to `v1.8`, maximizing performance for the `dynamics!` algorithm requires either setting the number of BLAS threads to 1 (`using LinearAlgebra; BLAS.set_num_threads(1)`) if using OpenBLAS (the default), or compiling Julia with MKL. See [this issue](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/issues/500) for more information.
412
513
Run `perf/runbenchmarks.jl` to see benchmark results for the Atlas robot (v5). Results below are for the following scenarios:
614

@@ -9,69 +17,62 @@ Run `perf/runbenchmarks.jl` to see benchmark results for the Atlas robot (v5). R
917
3. Do inverse dynamics.
1018
4. Do forward dynamics.
1119

12-
Note that results on CI builds are **not at all** representative because of code coverage. Results on a reasonably fast laptop at commit [870bea6](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/commit/870bea668d5b11ce0555fa0552592d2c3cb15c54):
20+
> **Note**
21+
> Results on CI builds are **not at all** representative because of code coverage.
1322
14-
Output of `versioninfo()`:
23+
Below are the results for **RBD.jl 2.5.0** (commit [`93a5ea`](https://github.com/JuliaRobotics/RigidBodyDynamics.jl/commit/93a5eaf15a5f6714b1ec1ce621b053542dcb721d)) using **Julia 1.11.1** on an **Apple MacBook Air (M2, 2023)** (16GB RAM, 512GB SSD):
1524

25+
Output of `versioninfo()`:
1626
```
17-
Julia Version 1.5.3
18-
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
27+
Julia Version 1.11.1
28+
Commit 8f5b7ca12ad (2024-10-16 10:53 UTC)
29+
Build Info:
30+
Official https://julialang.org/ release
1931
Platform Info:
20-
OS: macOS (x86_64-apple-darwin18.7.0)
21-
CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
32+
OS: macOS (arm64-apple-darwin22.4.0)
33+
CPU: 8 × Apple M2
2234
WORD_SIZE: 64
23-
LIBM: libopenlibm
24-
LLVM: libLLVM-9.0.1 (ORCJIT, skylake)
35+
LLVM: libLLVM-16.0.6 (ORCJIT, apple-m2)
36+
Threads: 1 default, 0 interactive, 1 GC (on 4 virtual cores)
2537
```
2638

27-
Note that this is a different machine than the one that was used for earlier benchmarks.
28-
29-
Mass matrix:
39+
> **Note**
40+
> This is a different machine than the one that was used for earlier benchmarks.
3041
42+
Mass matrix ([`mass_matrix!`](@ref)):
3143
```
32-
memory estimate: 0 bytes
33-
allocs estimate: 0
34-
--------------
35-
minimum time: 4.415 μs (0.00% GC)
36-
median time: 4.579 μs (0.00% GC)
37-
mean time: 4.916 μs (0.00% GC)
38-
maximum time: 19.794 μs (0.00% GC)
44+
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
45+
Range (min … max): 3.728 μs … 10.024 μs ┊ GC (min … max): 0.00% … 0.00%
46+
Time (median): 3.874 μs ┊ GC (median): 0.00%
47+
Time (mean ± σ): 3.903 μs ± 180.208 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
48+
Memory estimate: 0 bytes, allocs estimate: 0.
3949
```
4050

41-
Mass matrix and Jacobian from left hand to right foot:
42-
51+
Mass matrix ([`mass_matrix!`](@ref)) and Jacobian ([`geometric_jacobian!`](@ref)) from left hand to right foot:
4352
```
44-
memory estimate: 0 bytes
45-
allocs estimate: 0
46-
--------------
47-
minimum time: 4.860 μs (0.00% GC)
48-
median time: 4.982 μs (0.00% GC)
49-
mean time: 5.399 μs (0.00% GC)
50-
maximum time: 24.712 μs (0.00% GC)
53+
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
54+
Range (min … max): 3.941 μs … 9.020 μs ┊ GC (min … max): 0.00% … 0.00%
55+
Time (median): 4.103 μs ┊ GC (median): 0.00%
56+
Time (mean ± σ): 4.135 μs ± 196.842 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
57+
Memory estimate: 0 bytes, allocs estimate: 0.
5158
```
5259

5360
Note the low additional cost of computing a Jacobian when the mass matrix is already computed. This is because RigidBodyDynamics.jl caches intermediate computation results.
5461

55-
Inverse dynamics:
56-
62+
Inverse dynamics ([`inverse_dynamics!`](@ref)):
5763
```
58-
memory estimate: 0 bytes
59-
allocs estimate: 0
60-
--------------
61-
minimum time: 4.256 μs (0.00% GC)
62-
median time: 4.541 μs (0.00% GC)
63-
mean time: 4.831 μs (0.00% GC)
64-
maximum time: 21.625 μs (0.00% GC)
64+
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
65+
Range (min … max): 2.736 μs … 5.666 μs ┊ GC (min … max): 0.00% … 0.00%
66+
Time (median): 2.866 μs ┊ GC (median): 0.00%
67+
Time (mean ± σ): 2.882 μs ± 119.781 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
68+
Memory estimate: 0 bytes, allocs estimate: 0.
6569
```
6670

67-
Forward dynamics:
68-
71+
Forward dynamics ([`dynamics!`](@ref)):
6972
```
70-
memory estimate: 0 bytes
71-
allocs estimate: 0
72-
--------------
73-
minimum time: 13.600 μs (0.00% GC)
74-
median time: 14.419 μs (0.00% GC)
75-
mean time: 16.071 μs (0.00% GC)
76-
maximum time: 55.328 μs (0.00% GC)
73+
BenchmarkTools.Trial: 10000 samples with 10 evaluations.
74+
Range (min … max): 9.791 μs … 13.899 μs ┊ GC (min … max): 0.00% … 0.00%
75+
Time (median): 9.874 μs ┊ GC (median): 0.00%
76+
Time (mean ± σ): 9.942 μs ± 292.126 ns ┊ GC (mean ± σ): 0.00% ± 0.00%
77+
Memory estimate: 0 bytes, allocs estimate: 0.
7778
```

0 commit comments

Comments
 (0)