You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[lldb][swift] Cache location of Task Pointers for OperatingSystemSwiftTasks
Obtaining the TLS from debugserver over a wired (or slower) conection
was identified as a major source of slowdown after introducing
OperatingSystemSwiftTasks. This is due to multiple memory reads being
necessary:
1. Memory reads to obtain auxiliary information from libpthread that is
then sent to the jThreadExtendedInfo packet. See
"plo_pthread_tsd_base_address_offset","plo_pthread_tsd_base_offset"
and "plo_pthread_tsd_entry_size".
2. A packet requesting jThreadExtendedInfo.
Both 1 and 2 are done per thread, on every stop. However, there is
strong evidence that we can safely cache the TLS pointer after a certain
point in the thread lifetime, which is what this patch accomplishes.
Caching is done at the OperatingSystemSwiftTasks level, not at the
core Thread class. This is done for two reasons:
1. To minimize the surface area / risk of this change.
2. jThreadExtendedInfo can produce an invalid TLS address earlier in the
thread lifetime, so we can only cache this if a memory read at that
location is successful.
On local testing over a wired connection, this reduces stepping time by
about 100ms, from an average of 300ms.
0 commit comments