Sujet : Re: Does Python Need Virtual Threads? (Posting On Python-List Prohibited)
De : ldo (at) *nospam* nz.invalid (Lawrence D'Oliveiro)
Groupes : comp.lang.pythonDate : 17. Jun 2025, 03:12:03
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <102qiti$20fup$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10
User-Agent : Pan/0.162 (Pokrosvk)
On Sun, 15 Jun 2025 21:02:46 -0700, Paul Rubin wrote:
I'd be interested in seeing some benchmarks of multi-threaded Python
beating Erlang, if you have any to show.
Since you ask, I tried running up a simple program that creates lots of
dummy threads that do nothing but sleep for a few seconds, and reports on
its RAM usage by reading /proc/self/statm.
I am currently up to a bit over 25,000 threads (the default limit is
somewhere just under 26,000). The program reports its VM usage as over
200GB, which is way more than my total RAM + swap space, but in fact the
free(1) command reports that RAM and swap usage are nowhere that high. The
resident RAM usage while all the threads are running is reported at about
430MB.
In other words, multiply that by 40, and a million threads should get the
program’s RAM usage up to maybe 18GB.