-
Notifications
You must be signed in to change notification settings - Fork 49
Use JobPool for media loading #1210
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
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
necessary for mpmc Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
so I can make smaller commits for the jobs refactor Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
- able to run sync & async jobs, where async jobs just utilize the tokio async thread pool. - able to string together an arbitrary amount of sync & async calls back to back via a single nested closure - arbitrary preactions & payload delivery possible via closures - can use which ever job types necessary for app, since it uses generics for the output payload Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Signed-off-by: kernelkind <kernelkind@gmail.com>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, for each media loading request (for both on disk and from net) needed a separate
std::sync::thread. With many requests, this can cause alot of overhead. This PR makes it so all media loading requests go through theJobPool, and it is made easy to run combinations of synchronous and async jobs chained together for a single request.Additionally, apps can make their own job types which aren't tied to the media loading types by making a new
JobCache<K,T>and passing the type asKand job output asT. TheJobCachesupports pre action and completion closures, so the UI code touching the caching related structs can be immutable.Performance
On slow internet connections, performance compared to master is about the same. On fast internet connections, it is much improved. The following trace screenshots are recorded from a fresh install on a Pixel 2
General
This trace == this PR

external == master
wgpu_integration::WgpuWinitRunning::run_ui_and_paint
Not sure why, but this method took much less time on this PR than master, and had a massive decrease in SD from 28.7 ms to 3.74 ms.
Device::create_texture
On average 3.1 ms less per frame than master. The SD on master was 42 ms, now it is 5.56 ms
Note: take these figures with a grain of salt, we need a much more robust testing framework for repeatable results...