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

Make ImageLoader use background thread #5394

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

bircni
Copy link
Contributor

@bircni bircni commented Nov 20, 2024

This is the same change as in #4069 but as this is stale I wanted to reopen a non stale PR

Modifies ImageLoader's load function to use background threads for the image decoding work. This avoids blocking the main thread that is especially noticeable when loading many images at once.

This was modelled after the other loader implementations that also use threads.

Copy link

Preview available at https://egui-pr-preview.github.io/pr/5394-patch5375
Note that it might take a couple seconds for the update to show up after the preview_build workflow has completed.

@bircni
Copy link
Contributor Author

bircni commented Nov 20, 2024

I know the workaround for wasm is not the best so if you have any ideas - feel free to tell me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

image loader for file:// is blocking, while image loader for http:// runs fine.
1 participant