Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Limit work done per frame #229

Open
maxammann opened this issue Dec 15, 2022 · 0 comments
Open

Limit work done per frame #229

maxammann opened this issue Dec 15, 2022 · 0 comments
Labels
feature-request Request for a new feature good first issue Good for newcomers

Comments

@maxammann
Copy link
Collaborator

maxammann commented Dec 15, 2022

Even thought his can be done by newcomers, this issue is HARD

We need to do some work on the main thread:

  • Receive data from threads or WebWorkers
  • upload data to GPU

Here for example we process all the data we receive in the event loop:

https://github.com/maxammann/maplibre-rs/blob/2b917e9e0850d95c876bfcf0f0f3c777f56b842d/maplibre/src/stages/populate_tile_store_stage.rs#L41-L43

We could limit this to a certain amount of messages or the message sizes.

🤔 Expected Behavior

No frames should be dropped.

😯 Current Behavior

Sometimes frames are dropped because of uploads.

💁 Possible Solution

Limit the time spend on uploading or other work. This can either be done by measuring time (low level), or by restricting it on a higher level, e.g. the amount of work items.

Steps for this issue:

  1. Check where the most time is spent during the render loop using the Tracy profiler
  2. Reduce it by doing less work per frame.
@maxammann maxammann added good first issue Good for newcomers feature-request Request for a new feature labels Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request Request for a new feature good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

1 participant