2 ms·
How is bash performant? It is literally interpret by lines, and starting a whole process per if statements..
by kaba0 5y ago
How is bash performant? It is literally interpret by lines, and starting a whole process per if statements..
- Izkata 5y agoGuessing: Automatic parallelization in pipelines, just as long as there isn't a wall that has to consume all its input like "sort".
- bdowling 5y ago> How is bash performant? Typically, time spent interpreting control flow in a bash script is dwarfed by time spent in the programs called by the script. > It is literally interpret by lines It's just splitting lines into words to build up commands. It's not compiling C++. > starting a whole process per if statements.. In the common pattern `if command1; then command2; fi`, if command1 is a builtin (e.g., `test` or `[`), then bash does not create a subprocess.
- kaba0 5y agoStill doesn’t make it fast in any meaning of the word, which was my original criticism.
- bdowling 5y agoYou asked how bash is performant. I responded with reasons its performance is good in many applications. Here”s one more: bash starts up faster than other interpreters (e.g., Python), and startup time can often be a significant factor in overall performance.