4 ms·
As another example: I run https://shithub.us https://shithub.us with shell scripts, serving a terabyte or so of data monthly (mostly due to AI crawlers that I c
by ori_b 1y ago
As another example: I run https://shithub.us https://shithub.us with shell scripts, serving a terabyte or so of data monthly (mostly due to AI crawlers that I can't be arsed to block).
I'm launching between 15 and 3000 processes per request. While Plan 9 is about 10x faster at spawning processes than Linux, it's telling that 3000 C processes launching in a shell is about as fast as one python interpreter.
- kstrauser 1y agoThe interpreter itself is pretty quick: ᐅ time echo "print('hi'); exit()" | python hi ________________________________________________________ Executed in 21.48 millis fish external usr time 16.35 millis 146.00 micros 16.20 millis sys time 4.49 millis 593.00 micros 3.89 millis
- ori_b 1y agoMy machine is marginally faster for that; I get about 17ms doing that with python, without the print: time echo "exit()" | python3 real 0m0.017s user 0m0.014s sys 0m0.003s That's... still pretty slow. Here's a C program, run 100 times: range=`seq 100` time for i in $range; do ./a.out; done real 0m0.038s user 0m0.024s sys 0m0.016s And finally, for comparison on Plan 9: range=`{seq 2000} time rc -c 'for(s in $range){ ./6.nop }' 0.01u 0.09s 0.16r rc -c for(s in $range){ ./6.nop } the C program used was simply: int main(void) { return 0; } Of course, the more real work you do in the program, the less it matters -- but there's a hell of a lot you can do in the time it takes Python to launch.