Re: [dev] Re: coreutils / moreutils - DC a directory counter

From: Szabolcs Nagy <nsz_AT_port70.net>
Date: Thu, 18 Jul 2013 14:18:20 +0200

* Calvin Morrison <mutantturkey_AT_gmail.com> [2013-07-17 16:43:00 -0400]:
> On 17 July 2013 16:32, Christian Neukirchen <chneukirchen_AT_gmail.com> wrote:
> >> calvin_AT_ecoli:~/big_folder> time ls file2v1dir/ | wc -l
> >> 687560
> >>
> >> real 0m7.798s
> >> user 0m7.317s
> >> sys 0m0.700s
> >>
> >> calvin_AT_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
Received on Thu Jul 18 2013 - 14:18:20 CEST

This archive was generated by hypermail 2.3.0 : Thu Jul 18 2013 - 14:24:12 CEST