[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: 5000 Folders in a directory



-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Thu, Feb 18, 2016 at 07:05:03PM +0100, Jean-Baptiste Thomas wrote:
> > *samueloph@teste:~/foo$ time ( for i in $(seq 0 9999) ; do touch $i ; done
> > )real    0m10.245suser    0m3.332ssys    0m1.576s*
> > Using shell built-in ">" to create 10000 files:
> >
> > *samueloph@teste:~/foo$ time ( for i in $(seq 0 9999) ; do > $i ; done
> > )real    0m0.742suser    0m0.064ssys    0m0.120s*
> >
> > ">" is at least 10x faster than touch.
> 
> Your spirit of healthy scepticism is admirable but what these
> tests compare is not so much the time it takes to create a file
> with ">" vs touch(1) than the time it takes to create a process
> relative to the time it takes for the shell to iterate through
> a for() loop.

Very true :-/

- -- t
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)

iEYEARECAAYFAlbG1rEACgkQBcgs9XrR2kYX3gCdEf5AmkWnmurMRwYfFViyCRcq
6PsAnRtT6Ek0UC6w8aAZSb53FAo74sIk
=A74R
-----END PGP SIGNATURE-----


Reply to: