3 ms·
Yeah, probably not. In any program, if you don't care about performance, you essentially don't need anything more than hashes and arrays (what Python/Perl/Ruby
by chubot 12y ago
Yeah, probably not. In any program, if you don't care about performance, you essentially don't need anything more than hashes and arrays (what Python/Perl/Ruby/JS provide).
In a shell you don't care about runtime performance because all the cost is in the invoked programs. Ironically you probably care about parsing performance more than execution performance, because parsing happens at startup and can cause latency.
You will have a stack since I think shells have some form of scope, but that's pretty much an array.
- sanxiyn 12y ago> In a shell you don't care about runtime performance because all the cost is in the invoked programs. This is not strictly true. In a reasonable shell many commands will be builtin, because invoking processes for, say, echo, is slow.
- chubot 12y agoWhat you said is true, but it doesn't make what I said untrue. It could be that 99% of the statements are executed by shell builtins. But for essentially any shell script I've seen, speeding those up by 10x won't make any difference, because the real work is invoking compilers, linkers, invoking curl, tar, gzip, etc. As well as simple process creation overhead.