perf: skip large Window and AppHandle fields on traces (#8318)

* 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
This commit is contained in:
Robin van Boven 2023-11-30 15:56:24 +01:00 committed by GitHub
parent 977a39f4f7
commit c4b5df12bb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 2 deletions

View File

@ -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 }}

View File

@ -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>,

View File

@ -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,