Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into cmc/datastore/get_rid…
Browse files Browse the repository at this point in the history
…_of_copies
  • Loading branch information
teh-cmc committed Dec 18, 2022
2 parents d3a33cf + fc44e1f commit 9091e29
Show file tree
Hide file tree
Showing 30 changed files with 138 additions and 165 deletions.
2 changes: 2 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ Be terse when it doesn't hurt readability. BAD: `message_identifier`. GOOD: `msg

Avoid negations in names. A lot of people struggle with double negations, so things like `non_blocking = false` and `if !non_blocking { … }` can become a source of confusion and will slow down most readers. So prefer `connected` over `disconnected`, `initialized` over `uninitialized` etc.

For UI functions (functions taking an `&mut egui::Ui` argument), we use the name `ui` or `_ui` suffix, e.g. `blueprint_ui(…)` or `blueprint.ui(…)`.

#### Spaces
Points, vectors, rays etc all live in different _spaces_. Whenever there is room for ambiguity, we explicitly state which space something is in, e.g. with `ray_in_world`.

Expand Down
1 change: 0 additions & 1 deletion Cargo.lock

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

6 changes: 4 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@ repository = "https://github.com/rerun-io/rerun"

[workspace.dependencies]
anyhow = "1.0"
arrow2 = { version = "0.14" }
arrow2_convert = { version = "0.3" }
arrow2 = "0.14"
arrow2_convert = "0.3"
lazy_static = "1.4"
polars-core = "0.25"
polars-lazy = "0.25"
puffin = "0.14"
thiserror = "1.0"

[profile.dev]
Expand Down
6 changes: 2 additions & 4 deletions crates/re_data_store/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ publish = false
[features]
default = []

## Add support for the [`puffin`](https://github.com/EmbarkStudios/puffin) profiler.
puffin = ["dep:puffin", "re_log_types/puffin"]

## Enable (de)serialization using serde.
serde = ["dep:serde", "re_log_types/serde"]

Expand All @@ -34,7 +31,8 @@ thiserror = "1.0"

# Native dependencies:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
puffin = { version = "0.14", optional = true }
puffin.workspace = true


[dev-dependencies]
criterion = "0.4"
Expand Down
6 changes: 3 additions & 3 deletions crates/re_data_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ pub enum TimeQuery<Time> {
/// Get all the data within this time interval, plus the latest
/// one before the start of the interval.
///
/// Motivation: all data is considered alive untl the next logging
/// Motivation: all data is considered alive until the next logging
/// to the same data path.
Range(std::ops::RangeInclusive<Time>),
}
Expand All @@ -99,7 +99,7 @@ impl TimeQuery<i64> {
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}
Expand All @@ -109,7 +109,7 @@ macro_rules! profile_function {
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
5 changes: 1 addition & 4 deletions crates/re_log_types/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ load = ["anyhow", "rmp-serde", "serde", "zstd", "ruzstd"]
## Add support for some math operations using [`glam`](https://crates.io/crates/glam/).
glam = ["dep:glam", "dep:macaw"]

## Add support for the [`puffin`](https://github.com/EmbarkStudios/puffin) profiler.
puffin = ["dep:puffin"]

## Enable saving data to a file.
save = ["anyhow", "rmp-serde", "serde", "zstd"]

Expand Down Expand Up @@ -63,14 +60,14 @@ uuid = { version = "1.1", features = ["serde", "v4", "js"] }
anyhow = { workspace = true, optional = true }
glam = { version = "0.20", optional = true } # can't update glam until a new version of `macaw` is released
macaw = { version = "0.17", optional = true }
puffin = { version = "0.14", optional = true }
rand = { version = "0.8", optional = true }
rmp-serde = { version = "1", optional = true }
serde = { version = "1", features = ["derive", "rc"], optional = true }
serde_bytes = { version = "0.11", optional = true }

# Native dependencies:
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
puffin.workspace = true
zstd = { version = "0.11.0", optional = true } # native only

# Web dependencies:
Expand Down
4 changes: 2 additions & 2 deletions crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ impl PathOp {
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}
Expand All @@ -428,7 +428,7 @@ macro_rules! profile_function {
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
5 changes: 1 addition & 4 deletions crates/re_renderer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ publish = false
[features]
default = ["import-obj", "import-gltf"]

## Add support for the [`puffin`](https://github.com/EmbarkStudios/puffin) profiler.
puffin = ["dep:puffin"]

import-obj = ["dep:tobj"]
import-gltf = ["dep:gltf"]

Expand Down Expand Up @@ -49,7 +46,7 @@ tobj = { version = "3.2", optional = true }
[target.'cfg(not(target_arch = "wasm32"))'.dependencies]
crossbeam = "0.8"
notify = "5.0"
puffin = { version = "0.14", optional = true }
puffin.workspace = true
wgpu = { version = "0.14", default-features = false, features = ["wgsl"] }
wgpu-core = "0.14"

Expand Down
4 changes: 2 additions & 2 deletions crates/re_renderer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ pub(crate) const fn next_multiple_of(cur: u32, rhs: u32) -> u32 {
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}
Expand All @@ -76,7 +76,7 @@ macro_rules! profile_function {
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
19 changes: 5 additions & 14 deletions crates/re_viewer/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,21 +18,12 @@ crate-type = ["cdylib", "rlib"]


[features]
default = ["puffin"]

## Add support for the [`puffin`](https://github.com/EmbarkStudios/puffin) profiler.
puffin = [
"dep:puffin",
"dep:puffin_http",
"eframe/puffin",
"re_log_types/puffin",
"re_renderer/puffin",
]
default = []


[dependencies]
re_arrow_store = { path = "../re_arrow_store" }
re_data_store = { path = "../re_data_store", features = ["puffin", "serde"] }
re_data_store = { path = "../re_data_store", features = ["serde"] }
re_error = { path = "../re_error" }
re_format = { path = "../re_format" }
re_log = { path = "../re_log" }
Expand All @@ -50,10 +41,10 @@ ahash = "0.8"
anyhow.workspace = true
bytemuck = { version = "1.11", features = ["extern_crate_alloc"] }
cgmath = { version = "0.18", features = ["mint"] }
document-features = "0.2"
eframe = { version = "0.20", default-features = false, features = [
"default_fonts",
"persistence",
"puffin",
"wgpu",
] }
egui = { version = "0.20", features = ["extra_debug_asserts", "tracing"] }
Expand Down Expand Up @@ -91,8 +82,8 @@ arboard = { version = "3.2", default-features = false, features = [
"image-data",
] }
ctrlc = { version = "3.0", features = ["termination"] }
puffin = { version = "0.14", optional = true }
puffin_http = { version = "0.11", optional = true }
puffin_http = "0.11"
puffin.workspace = true

# web dependencies:
[target.'cfg(target_arch = "wasm32")'.dependencies]
Expand Down
10 changes: 5 additions & 5 deletions crates/re_viewer/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ impl App {
}
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
pub fn set_profiler(&mut self, profiler: crate::Profiler) {
self.state.profiler = profiler;
}
Expand Down Expand Up @@ -231,7 +231,7 @@ impl App {
self.reset(egui_ctx);
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
if egui_ctx
.input_mut()
.consume_shortcut(&kb_shortcuts::SHOW_PROFILER)
Expand Down Expand Up @@ -627,7 +627,7 @@ struct AppState {
selection_history: crate::SelectionHistory,
time_panel: crate::time_panel::TimePanel,

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
#[serde(skip)]
profiler: crate::Profiler,
}
Expand All @@ -653,7 +653,7 @@ impl AppState {
selection_panel,
selection_history,
time_panel,
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
profiler: _,
} = self;

Expand Down Expand Up @@ -1152,7 +1152,7 @@ fn view_menu(ui: &mut egui::Ui, app: &mut App, frame: &mut eframe::Frame) {
ui.close_menu();
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
if ui
.add(
egui::Button::new("Profile Viewer")
Expand Down
10 changes: 3 additions & 7 deletions crates/re_viewer/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@
//!
//! This crate contains all the GUI code for the Rerun Viewer,
//! including all 2D and 3D visualization code.
//!
//! ## Feature flags
#![doc = document_features::document_features!()]
//!
mod app;
pub mod env_vars;
Expand All @@ -30,7 +26,7 @@ mod native;
#[cfg(not(target_arch = "wasm32"))]
pub use native::{run_native_app, run_native_viewer_with_messages};

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
pub use misc::profiler::Profiler;

// ----------------------------------------------------------------------------
Expand All @@ -48,7 +44,7 @@ pub use web::start;
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}
Expand All @@ -58,7 +54,7 @@ macro_rules! profile_function {
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/misc/clipboard.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ impl Clipboard {
}
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))] // only used sometimes
#[cfg(not(target_arch = "wasm32"))] // only used sometimes
pub fn set_text(&mut self, text: String) {
if let Some(clipboard) = &mut self.arboard {
if let Err(err) = clipboard.set_text(text) {
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/misc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ pub(crate) use clipboard::Clipboard;
pub(crate) use time_control::{TimeControl, TimeView};
pub(crate) use viewer_context::*;

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
pub(crate) mod profiler;

#[cfg(not(target_arch = "wasm32"))]
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/remote_viewer_app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ impl RemoteViewerApp {
self.app = Some((connection, app));
}

#[cfg(all(feature = "puffin", not(target_arch = "wasm32")))]
#[cfg(not(target_arch = "wasm32"))]
pub fn set_profiler(&mut self, profiler: crate::Profiler) {
if let Some((_, app)) = &mut self.app {
app.set_profiler(profiler);
Expand Down
2 changes: 1 addition & 1 deletion crates/re_viewer/src/ui/class_description_ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use re_log_types::{IndexHash, MsgId};

use crate::{misc::ViewerContext, ui::annotations::auto_color};

pub(crate) fn view_class_description_map(
pub(crate) fn class_description_ui(
ctx: &mut ViewerContext<'_>,
ui: &mut egui::Ui,
instance_id: &InstanceId,
Expand Down
Loading

1 comment on commit 9091e29

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rust Benchmark

Benchmark suite Current: 9091e29 Previous: fc44e1f Ratio
datastore/batch/rects/insert 213240 ns/iter (± 404) 1694152 ns/iter (± 14277) 0.13
datastore/batch/rects/query 682 ns/iter (± 1) 679 ns/iter (± 9) 1.00
obj_mono_points/insert 963319606 ns/iter (± 5031966) 885898765 ns/iter (± 10476244) 1.09
obj_mono_points/query 328738 ns/iter (± 675) 328006 ns/iter (± 2050) 1.00
obj_batch_points/insert 94383366 ns/iter (± 508052) 85272030 ns/iter (± 584699) 1.11
obj_batch_points/query 11302 ns/iter (± 26) 11319 ns/iter (± 169) 1.00
obj_batch_points_sequential/insert 22844758 ns/iter (± 279292) 22626893 ns/iter (± 370931) 1.01
obj_batch_points_sequential/query 7910 ns/iter (± 84) 7771 ns/iter (± 26) 1.02
arrow_mono_points/insert 27235112 ns/iter (± 1944163) 241264230 ns/iter (± 858344) 0.11
arrow_mono_points/query 733547 ns/iter (± 2695) 714520 ns/iter (± 7196) 1.03
arrow_batch_points/insert 135118 ns/iter (± 327) 955130 ns/iter (± 6539) 0.14
arrow_batch_points/query 11475 ns/iter (± 23) 11315 ns/iter (± 134) 1.01
obj_batch_points_sequential/Tuid::random 37 ns/iter (± 0) 37 ns/iter (± 0) 1

This comment was automatically generated by workflow using github-action-benchmark.

Please sign in to comment.