bevyengine / bevyengine/bevy

Add an example demonstrating how to load your assets sequentially to reduce memory usage on web platforms

Open
#12,653 1 comment 0 reactions 0 assignees View on GitHub
A-Assets C-Examples C-Performance O-Web
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## What problem does this solve or what need does it fill?

On WASM, memory cannot be reclaimed / freed. As a result, loading all of your assets up front in a loading-screen pattern will balloon your memory usage and it will never go back down. See https://github.com/bevyengine/bevy/issues/12057 for more context.

## What solution would you like?

Add an example demonstrating how to load assets one at a time, and then moving them onto the GPU using `RenderAssetUsage` once loaded.

Explain why this is useful for web.

## What alternative(s) have you considered?

We could make this the default behavior on wasm.

## Additional context

This came up when helping a commercial user debug performance issues on iOS.

Contributor guide

Open the contributing guide

Research direction

Start by reviewing the asset-loading approach described in this issue and the RenderAssetUsage API, then read the related context in issue #12057. Done means an example loads assets sequentially, moves each onto the GPU with RenderAssetUsage, and explains why this reduces unreclaimed memory on web platforms.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust, wasm
Domain
game-dev, performance
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.