Open
Description
Currently, when coroutines debug mode is enabled, the following machinery is enabled:
- Every coroutine created is supplied with
CoroutineId
. This one might be useful for local debugging and logging, though its general applicability (i.e. for running applications of IDEA scale, the purpose of numeric id is unclear) - Stacktrace population for
JobCancellationException
is enabled, which is known to be a performance-hitter (we also know it from IDEA experience) Thread.setName
with coroutine id is invoked. This seemed to be the legacy of earlier days when we had little to no tooling around coroutines debugging. It has three downsides: it crashes ART consistently (Android ART Native Crash sometimes occurs when changing a threads nameย #2234), it might dominate coroutine-specific workloads (Android ART Native Crash sometimes occurs when changing a threads nameย #2234 (comment)), and it potentially interferes with code that leverages thread names.- Stacktrace recovery is enabled. I like this one and have no intention of tweaking it :)