Glenn Fowler requests: > if it works post a timing comparison Here are some timing tests. For ksh, I used the dgk code posted later. I ran each test listed below 3 times. The results below are the middle time. The file I used is the zsh configure script, because:
* it is over 20,000 lines long, so * it is representative of things I had in mind and * I had previously used and reported on that elsewhere. wc says of this file: 21124 67719 555992 ./zsh/configure I ran the tests below on an Ubuntu 8.3 thinkpad laptop with an Intel Centrino CPU: Model: 6.15.13 "Intel(R) Core(TM)2 Duo CPU T5450 @ 1.66GHz" First, the fast ksh code with the IFS and glob settings: $ time /tmp/kshrf.sh real 0m0.099s user 0m0.080s sys 0m0.008s This is a comparable and a little faster than the code for zsh: $ time /tmp/zshrf.sh real 0m0.193s user 0m0.176s sys 0m0.008s But what's also impressive is that even the slow ksh code isn't all that slow: $ time /tmp/kshrs.sh real 0m1.456s user 0m0.760s sys 0m0.696s Especially when you compare with zsh: real 0m15.874s user 0m1.420s sys 0m0.092s or bash: real 0m4.980s user 0m4.208s sys 0m0.760s But it looks like the custom array reading code I wrote does pretty good here: real 0m0.032s user 0m0.024s sys 0m0.008s (I wrote this builtin out of frustration and desperation, not a desire to get the last ounce of speed. At the time, the speed difference was more on the order of minutes than seconds. So it's possible bash has improved or I was encountering files even larger than 20,000 or I had a slower computer. For zshdb and kshdb I am very happy with the results reported above.) Thanks, everyone! _______________________________________________ ast-users mailing list [email protected] https://mailman.research.att.com/mailman/listinfo/ast-users
