4 ms·
Fun fact: because of tkinter, Python embeds a TCL interpreter: >>> import tkinter as tk >>> tk.Tcl().eval('puts {hello, world}') hello, world '
by BiteCode_dev 4y ago
Fun fact: because of tkinter, Python embeds a TCL interpreter:
>>> import tkinter as tk
>>> tk.Tcl().eval('puts {hello, world}')
hello, world
''
So you could technically use TCL to query your DB if you cared.
But honestly, DB queries in real life is spread on threads, but then multiple processes, then a connection pool like pg bouncer, so you will unlikely see the difference most of the time. Not to mention the DB choice, the schema, the query quality, the DB configuration, the hardware and how complicated your request are all going to be more likely to affect the speed of request.
Still, interesting. Exploiting all those CPU in Python would cost a lot of RAM given how many processes you would have to spawn.
I would love to see the comparison using asyncio on uvloop to check the CPU are really the bottleneck though.