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

desktop: Use async IO for file browsing in AVM #19134

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

kjarosh
Copy link
Member

@kjarosh kjarosh commented Jan 4, 2025

Using async IO means we're not blocking the main thread and the content doesn't freeze while reading.

In theory, Ruffle should use only async IO, as otherwise the main thread will be blocked by every bit of IO performed. According to my knowledge this is the first instance of using async IO in Ruffle.

Things to consider:

@kjarosh kjarosh added A-desktop Area: Desktop Application T-perf Type: Performance Improvements labels Jan 4, 2025
@torokati44 torokati44 force-pushed the browse-fs-async branch 2 times, most recently from 0a75523 to 1f709e7 Compare January 10, 2025 18:17
@torokati44
Copy link
Member

Do you think this is mergeable as is, despite the points of doubt mentioned above, @kjarosh?

@kjarosh
Copy link
Member Author

kjarosh commented Jan 11, 2025

In my opinion:

  1. This particular case of IO is caused by user interaction, so slight performance drop is perfectly acceptable especially if it makes the application responsive.

  2. I think all async APIs are drop in replacements of std::fs, so we can easily switch to a different backend in the future if we decide.

IMO it's fine to merge, we should be aware of those issues when migrating the rest of IO.

Using async IO means we're not blocking the main thread and the content
doesn't freeze while reading.
@torokati44 torokati44 enabled auto-merge (rebase) January 11, 2025 22:41
@torokati44
Copy link
Member

Alright, thank you!

@torokati44 torokati44 merged commit 28c17fd into ruffle-rs:master Jan 11, 2025
22 checks passed
@kjarosh kjarosh deleted the browse-fs-async branch January 12, 2025 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-desktop Area: Desktop Application T-perf Type: Performance Improvements
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants