-
SpirvShaderDebugger: Reduce lock contention · 6740e07aBen Clayton authored
Previously the way to create `VariableContainer`s was to call `createVariableContainer()` on the `Context::Lock`. This was required so that debug-client requests to inspect the container's contents can be done with a simple map lookup. Creating variable containers is a high frequency operation, and obtaining a `Context::Lock` (unsurprisingly) requires acquiring a mutex lock, which across multiple threads results in significant mutex lock contention. To dramatically help with debugger performance, we can now construct `VariableContainer`s outside of the lock. This is achieved by registering the variable container in the context map only when it is handed to the client. This only occurs when there's a DAP transaction, which is orders of magnitude less frequent. Bug: b/148401179 Change-Id: I58eca33aac8fd4711dd9756072a6a06efdacc671 Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/48428 Kokoro-Result: kokoro <noreply+kokoro@google.com> Reviewed-by:
Jaebaek Seo <jaebaek@google.com> Reviewed-by:
Nicolas Capens <nicolascapens@google.com> Tested-by:
Ben Clayton <bclayton@google.com>
6740e07a
×