* Calvin Morrison <mutanttur...@gmail.com> [2013-07-17 16:43:00 -0400]: > On 17 July 2013 16:32, Christian Neukirchen <chneukirc...@gmail.com> wrote: > >> calvin@ecoli:~/big_folder> time ls file2v1dir/ | wc -l > >> 687560 > >> > >> real 0m7.798s > >> user 0m7.317s > >> sys 0m0.700s > >> > >> calvin@ecoli:~/big_folder> time ~/bin/dc file2v1dir/ > >> 687560 > >> > >> real 0m0.138s > >> user 0m0.057s > >> sys 0m0.081s > >> > >> What do you think? > >> Calvin > > > > 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. >
if it's coreutils ls|wc then most of the time is locale specific code (strcoll and encoding related), try export LC_ALL=C ls -f |wc -l