“My current thinking about Python asyncio & why I hate it”
charlesleifer.com
charlesleifer.com
Me too! If I have to remember to add await and async to avoid accidentally breaking my code, why don't I just write in Go instead? At least I get some safety checks from the compiler.
Huh? In what planet? Rendering a template takes negligible time compared to the IO latencies to read from the database (even for a fast simple query) or a cold file on the filesystem.
This (and not the extra v8 speed) is why a single process Node.js server gets great performance for a typical web app, better than anything single process but synchronous Python could ever dream of -- and that a blocking Node.js would fall back to Python-level performance for web serving scenario.
>Whether they're actually going fast or not is anyone's guess. The best you're likely to see is some dubious graph from a half-baked benchmark.
Dubious compared to what? The "take my word for it, it is bad" blogger opinion?
If you're talking to a regular sql database you'll usually find the database itself limits concurrency so there's little advantage to async io over threading. You really only see the advantage of async io in proxy like scenarios or where you're managing thousands of long lived connections (web sockets etc.)
And mainly it is because it is all or nothing. It is a terrible design that we are now stuck with...
i hate the overall design concept of threading. it's not just Python that's bad at it, it's evident in most languages that thread management is not bad because of the implementation, it's bad because systemically the design of process threads is clumsy and not at all simple or graceful.