7 comments

[ 4.5 ms ] story [ 25.9 ms ] thread
wiwm i'd imagine it has a 3rd party tool. very nice to get it out of the box in 3.15
What I like about profiling.tracing is how you can control it in the same code base that you are profiling. That turns tracing into a feature you can ship, not just a tool you can attach. Profiling.sampling doesn't seem to provide anything similar, it has to run as a separate process
This sounds a lot like py-spy. How does it compare?
I'm not trying to criticize, but Python is known to be much slower than eg. Java or Go etc. So for performance-critcal code, why use Python? I find Python to be very good because it is concise and simple, but I have not used it for production so far.
It's super easy. If you collaborate with non-software people (say, in hardware engineering), there's not many good alternatives. I've seen attempts at DSLs, Lua, and Perl, C (disaster) but Python lets anyone dig down and understand/debug.
I wrote a logistics optimization program (think travelling-salesman++) in Python and it gradually took over from the v1 version written in Java.

People generally compare "speed of execution" to "speed of coding".

I'll add "speed of troubleshooting". When something goes wrong and the clock is ticking, you need tools to identify quickly if the data is inconsistent, a config set wrongly or the algorithm stuck at a local optimum. And then decide if things can be mitigated with a patch or we should we grovel and buy time from the client... All of this is much easier in Python (bar the grovelling).

LLMs are changing things though. I recently ported a complex part of the kernel to C++. 90% of it was creating the scaffolding before the actual algorithms were ported. Very tedious work but Claude can just chug through. Wouldn't like to maintain it just yet.

Interesting, does wall-time mode work with Asyncio?

Imagine if I have a single request calling asyncio.gather() on 5 different coroutines. Only 1 is on CPU, the other 4 are on IO. Is Tachyon able to sample all 5 coroutine tasks?