Skip to content

Commit

Permalink
Simple logging benchmarks for C++ & Rust (#4181)
Browse files Browse the repository at this point in the history
### What

* Part of #4100

Implements SDK sided logging benchmark for C++ & Rust.
Kept as simple as possible, meant for whole-process profiling so we
capture all sideeffects. This makes tthe data generation ('prepare')
inside the benchmark apps ofc quite tricky as it has to be as fast as
possible.
Additionally, both Rust & Cpp app expose a way to get more fine grained
logging. Cpp does this via a simple profiler scope, Rust via
Puffin/re_tracing.

Logging always happens to a memory recording.
Data is currently never passed in in the Rerun format

Contains the tree initial benchmarks we wanted to have:
* points3d_large_batch
* Single batch of 50mio points (color, position, radius, single label)
* points3d_many_individual
* 1mio individual points with different time stamp each (color,
position, radius)
* image
   * log 4 different 16k x 16k RGBA8 images (4GiB of memory!)

Running instructions in `main.rs` & `main.cpp`!


Timings on my M1 Max in seconds
(tests are not perfectly comparable, they do not do the exact same
thing. Prepare times are also slightly different and most significant in
the _large_batch test)

* points3d_large_batch
   * C++:  0.94s
   * Rust: 1.34s
* points3d_many_individual
* C++: 16.86s (⚠️ there's almost certainly some involuntary allocation
going on there)
   * Rust: 2.75s
* image
   * C++: 3.11s
   * Rust: 1.10s


Missing
* Python version
* utility script for building, running and publishing data


### Checklist
* [x] I have read and agree to [Contributor
Guide](https://github.com/rerun-io/rerun/blob/main/CONTRIBUTING.md) and
the [Code of
Conduct](https://github.com/rerun-io/rerun/blob/main/CODE_OF_CONDUCT.md)
* [x] I've included a screenshot or gif (if applicable)
* [x] I have tested [demo.rerun.io](https://demo.rerun.io/pr/4181) (if
applicable)
* [x] The PR title and labels are set such as to maximize their
usefulness for the next release's CHANGELOG

- [PR Build Summary](https://build.rerun.io/pr/4181)
- [Docs
preview](https://rerun.io/preview/73a3736ac3c0be33fa8d6e6b40a2af243c4aa2d9/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/73a3736ac3c0be33fa8d6e6b40a2af243c4aa2d9/examples)
<!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
Wumpf committed Nov 9, 2023
1 parent b8ea6af commit 1aa220a
Show file tree
Hide file tree
Showing 21 changed files with 3,855 additions and 3,820 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ crates/re_types_builder/source_hash.txt
*.o
**/arrow/
**/build/
**/build-msvc/
**/CMakeFiles/
**/CMakeCache.txt
**/Makefile
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ members = [
"docs/code-examples",
"rerun_py",
"run_wasm",
"tests/rust/test_*",
"tests/rust/log_benchmark",
"tests/rust/roundtrips/*",
"tests/rust/test_*",
]

[workspace.package]
Expand Down Expand Up @@ -80,6 +81,7 @@ async-executor = "1.0"
backtrace = "0.3"
bincode = "1.3"
bitflags = "1.3"
blackbox = "0.2.0"
bytemuck = { version = "1.11", features = ["extern_crate_alloc"] }
camino = "1.1"
cargo-run-wasm = "0.3.2"
Expand Down
Loading

0 comments on commit 1aa220a

Please sign in to comment.