bevyengine / bevyengine/bevy

detailed_trace feature on wasm grows faster than on native

Open
#19,431 3 comments 0 reactions 0 assignees View on GitHub
A-Diagnostics C-Bug C-Performance O-Web S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 22h
Merged PRs (30d)
161

Description

hello !

## Bevy version

0.16.0

## \[Optional\] Relevant system information

If you cannot get Bevy to build or run on your machine, please include:

cargo 1.87.0-nightly (307cbfda3 2025-03-20)
linux wayland
tested both latest firefox and chromium

## What you did

```
// can be any examples
cargo build --target wasm32-unknown-unknown --example sprite_sheet -F bevy/detailed_trace
wasm-server-runner target/wasm32-unknown-unknown/debug/examples/sprite_sheet.wasm
```
Observe the memory usage of the tab growing, for me its ~40mb/s or 1gb/25sec.

## What went wrong

the memory usage keeps growing until crash.
the performance of the bevy app is also greatly impacted, near 30% fps loss, with big drop to two digits fps every few seconds.

## Additional information

i dont think the performance loss is just the overhead of detailed trace. on mobile, i go from 144fps to 10. maybe just the allocation in loop.
this problem didn't occur on bevy 0.15.0 (the feature is new anyway i think?)
ive tried disabling logs at compile time with log and tracing features max level info but didn't work.

this might NOT be a memory leak, i just feel like its better for the title, as its more concrete and the end problem is the same.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.