Skip to content

Commit

Permalink
perf: skip large Window and AppHandle fields on traces (#8318)
Browse files Browse the repository at this point in the history
* perf: Skip large Window and AppHandle fields on traces

These contain large fields like image buffers, causing spans/events to be very large when serialized.

Especially the `window::emit::eval` one which is in a hot code path.

* fix: MSRV issues
  • Loading branch information
Beanow authored Nov 30, 2023
1 parent 977a39f commit c4b5df1
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/test-core.yml
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,9 @@ jobs:
cargo update -p bstr --precise 1.6.2
cargo update -p backtrace --precise 0.3.68
cargo update -p blocking --precise 1.4.1
cargo update -p ignore --precise 0.4.18
cargo update -p regex --precise 1.9.6
cargo update -p globset --precise 0.4.13
- name: test
run: cargo test --target ${{ matrix.platform.target }} ${{ matrix.features.args }}
2 changes: 1 addition & 1 deletion core/tauri/src/plugin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ impl<R: Runtime> PluginStore<R> {
}
}

#[cfg_attr(feature = "tracing", tracing::instrument(name = "plugin::hooks::initialize", skip(plugin), fields(name = plugin.name())))]
#[cfg_attr(feature = "tracing", tracing::instrument(name = "plugin::hooks::initialize", skip(plugin, app), fields(name = plugin.name())))]
fn initialize<R: Runtime>(
plugin: &mut Box<dyn Plugin<R>>,
app: &AppHandle<R>,
Expand Down
2 changes: 1 addition & 1 deletion core/tauri/src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1804,7 +1804,7 @@ impl<R: Runtime> Window<R> {

#[cfg_attr(feature = "tracing", tracing::instrument(
"window::emit::eval",
skip(emit_args),
skip(self, emit_args),
fields(
event = emit_args.event,
source_window = emit_args.source_window_label,
Expand Down

0 comments on commit c4b5df1

Please sign in to comment.