understanding Python asyncio profiler output
<p>I'm trying to understand the output of Python profiler while running Python asyncio based program:</p>

<p><a href="http://i.stack.imgur.com/LqYaw.png" rel="nofollow"><img src="http://i.stack.imgur.com/LqYaw.png" alt="Python3 asyncio profiler output"></a></p>

<p>I can see that my program is spending ~67% of time trying to acquire a thread lock. </p>

<ol>
<li><p>Is this normal in asyncio programs? My application is single-threaded, I am not deferring any work to worker threads and logging minimally to console.</p></li>
<li><p>My app spends ~21% in select call. Does this roughly mean that 20% of run-time is spent idle (waiting for an event or callback to happen)?</p></li>
</ol>

<p>Looks like you are using debugger that collects data from all threads.
Waiting for condition variable acquiring means an idle waiting in thread pool for new tasks.</p>

<p>Time spent in <code>select</code> means again idle waiting, but in this case it's waiting for network activity.</p>

python python-3.x profiling python-asyncio