Bash array iteration direction and performance

爱⌒轻易说出口 提交于 2019-12-04 19:57:16

Found some info on the matter.

According to http://www.tldp.org/LDP/abs/html/arrays.html

Arrays in Bash are (circularly) linked lists of type string (char *).

I guess this means that the passed elements are sought from the beginning of the array each time, hence the slowdown. (eg: if we are at i, in order to get to i-1, we should start looking from 0)

Also found a related post with some more info on the matter: http://spencertipping.com/posts/2013.0814.bash-is-irrecoverably-broken.html

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!