Skip to content

Commit

Permalink
fix(node-wasm): Fix high memory consumption
Browse files Browse the repository at this point in the history
`tracing_web::performance_layer` was causing high memory consumption
because browser was keeping high resolution data for each tracing event.

Fixes #352 and #353
  • Loading branch information
oblique committed Aug 1, 2024
1 parent df62e20 commit fa4e77c
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions node-wasm/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,8 @@ pub fn setup_logging() {
.with_timer(UtcTime::rfc_3339()) // std::time is not available in browsers
.with_writer(MakeConsoleWriter) // write events to the console
.with_filter(LevelFilter::INFO); // TODO: allow customizing the log level
let perf_layer = performance_layer().with_details_from_fields(Pretty::default());

tracing_subscriber::registry()
.with(fmt_layer)
.with(perf_layer)
.init();
tracing_subscriber::registry().with(fmt_layer).init();
}

impl From<Network> for network::Network {
Expand Down

0 comments on commit fa4e77c

Please sign in to comment.