Suggestion to introduce wgpu-sync for lock profiling #5183
Closed
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.
Connections
Initially I started working on this to introduce loom tests, but I figured building a face like this would be useful to troubleshoot potential issues and bottlenecks caused by locks.
Could be used to troubleshoot issues which ask whether things have become slower with arcanization and increased use of locks in wgpu, such as #5180.
Description
This introduces a compatible layer which conditionally replaces Mutexes and RwLocks with facades which efficiently captures events into a global collection. This is compile-time enabled with the
"trace"
feature. Using this, users ofwgpu
can capture a lock trace, and generate a html report like this:I've included an example report I've generated from one of my projects here:
https://udoprog.github.io/trace.html
Note that if the
"trace"
feature is disabled, wgpu-sync instead provides the original parking_lot implementations without using facades.This is a draft for now. Please take a look and tell me if y'all are interested in adopting something like this.