2 ms·
Is the shell faster than Python I don't use Python as it's too slow for me, e.g., the startup time for the interpreter
by 1vuio0pswjnm7 10mo ago
Is the shell faster than Python
I don't use Python as it's too slow for me, e.g., the startup time for the interpreter
- rented_mule 10mo agopyinfra is for running things across a number of machines and/or containers. For example to provision them, much like Ansible. So Python's startup time isn't terribly relevant. Also, have you tried Python's startup time in the last decade or so? On my 2-year old, $150 computer with an Intel N100 (a very low-end CPU) running Ubuntu, `python3 -c "print('hello')"` takes 15ms. On my 8-year old Mac mini, it's 35ms. Both are significantly faster than what humans perceive as instantaneous, so Python's startup time is more than fast enough for many things.
- 1vuio0pswjnm7 10mo agoWhen I use the phrase "too slow" I am referring to being slow _relative to other interpreters_ I use, such as the Almquist shell intepreter (NetBSD sh or Debian's dash), the ngn-k interpreter, the spitbol interpreter, the dino interpreter, the lua interpeter, etc. HN commenters often state that "Python is (pre)installed everywhere" This is not true on the computers I operate. For example, there is no python interpreter in NetBSD's base.tgz Here we see a project that uses Python to run the shell, even though, if HN commenters are correct, "Python is (pre)installed everywhere" Of course, the shell _is_ preinstalled everywhere and this project relies on that fact IME, the shell and other interpreters are much faster than Python for what I need to do I am aware of Python's current speed as it is sometimes a compile-time requirement for third party software that I am compiling. I remove Python after I am done
- 1vuio0pswjnm7 10mo agoAlso, Python versus sed and AWK intepreters