On 7/17/13, Calvin Morrison <mutanttur...@gmail.com> wrote: > On 17 July 2013 16:32, Christian Neukirchen <chneukirc...@gmail.com> wrote:
>> What's the bottle neck here? > > Looking up the filenames and reading them, printing them to standard > out and then wc parsing for all the \n characters. Most ls implementations also sort the list of filenames by default. Is that the bottleneck? >> (Or is your dc only faster because the directory index is in cache >> now...) > > No that's not why: > > calvin@ecoli:~/big_folder> ls 2v1 | wc -l > 687560 > > real 0m7.678s > user 0m7.313s > sys 0m0.579s > > calvin@ecoli:~/big_folder> time dc 2v1 > 687560 > > real 0m0.138s > user 0m0.055s > sys 0m0.082s > > calvin@ecoli:~/big_folder> time ls 2v1 | wc -l > 687560 > > real 0m7.672s > user 0m7.310s > sys 0m0.580s Um. How often are you going to use this new C program which saves only 7.5 seconds? Robert Ransom