Skip to content

Commit

Permalink
Remove unused profiling macros (rerun-io#3090)
Browse files Browse the repository at this point in the history
### What
These were forgotten when `re_tracing` was created!?

### 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/3090) (if
applicable)

- [PR Build Summary](https://build.rerun.io/pr/3090)
- [Docs
preview](https://rerun.io/preview/e9943df41dd51a5d702e4d39162cbf68b600dd83/docs)
<!--DOCS-PREVIEW-->
- [Examples
preview](https://rerun.io/preview/e9943df41dd51a5d702e4d39162cbf68b600dd83/examples)
<!--EXAMPLES-PREVIEW--><!--EXAMPLES-PREVIEW-->
- [Recent benchmark results](https://ref.rerun.io/dev/bench/)
- [Wasm size tracking](https://ref.rerun.io/dev/sizes/)
  • Loading branch information
emilk authored Aug 24, 2023
1 parent 3582a55 commit f415cbd
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 64 deletions.
1 change: 1 addition & 0 deletions Cargo.lock

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

22 changes: 0 additions & 22 deletions crates/re_data_store/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,25 +59,3 @@ pub enum TimeQuery<Time> {
impl TimeQuery<i64> {
pub const EVERYTHING: Self = Self::Range(i64::MIN..=i64::MAX);
}

// ---------------------------------------------------------------------------

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
20 changes: 0 additions & 20 deletions crates/re_log_types/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -403,26 +403,6 @@ impl PathOp {

// ---------------------------------------------------------------------------

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}

#[doc(hidden)]
#[macro_export]
macro_rules! component_legacy_shim {
Expand Down
22 changes: 0 additions & 22 deletions crates/re_sdk/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -209,25 +209,3 @@ fn called_from_official_rust_example() -> bool {
}
is_official_example
}

// ---------------------------------------------------------------------------

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_function {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_function!($($arg)*);
};
}

/// Wrapper around puffin profiler on native, no-op on weasm
#[doc(hidden)]
#[macro_export]
macro_rules! profile_scope {
($($arg: tt)*) => {
#[cfg(not(target_arch = "wasm32"))]
puffin::profile_scope!($($arg)*);
};
}
1 change: 1 addition & 0 deletions crates/re_ws_comms/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ tls = [
[dependencies]
re_log.workspace = true
re_log_types = { workspace = true, features = ["serde"] }
re_tracing.workspace = true

anyhow.workspace = true
bincode = "1.3"
Expand Down
2 changes: 2 additions & 0 deletions crates/re_ws_comms/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ pub fn server_url(local_addr: &std::net::SocketAddr) -> String {
const PREFIX: [u8; 4] = *b"RR00";

pub fn encode_log_msg(log_msg: &LogMsg) -> Vec<u8> {
re_tracing::profile_function!();
use bincode::Options as _;
let mut bytes = PREFIX.to_vec();
bincode::DefaultOptions::new()
Expand All @@ -98,6 +99,7 @@ pub fn encode_log_msg(log_msg: &LogMsg) -> Vec<u8> {
}

pub fn decode_log_msg(data: &[u8]) -> Result<LogMsg, RerunServerError> {
re_tracing::profile_function!();
let payload = data
.strip_prefix(&PREFIX)
.ok_or(RerunServerError::InvalidMessagePrefix)?;
Expand Down

0 comments on commit f415cbd

Please sign in to comment.