Re: [dev] alternatives to find for querying the filesystem

From: Bobby Powers <bobbypowers_AT_gmail.com>
Date: Thu, 12 Dec 2013 17:26:46 -0500

Hello,

Andrew Gwozdziewycz wrote:
>> $ time find / | grep 'bin' > /dev/null
>> real 0m8.122s
>> user 0m3.101s
>> sys 0m2.519s
>>
>> $ time find / -regex 'bin' | grep
>> real 0m18.795s
>> user 0m3.394s
>> sys 0m3.401s

I get a different story on Linux 3.12.4:

[bpowers_AT_fina ~]$ time find / 2>/dev/null | grep 'bin' > /dev/null
real 0m2.316s
user 0m1.145s
sys 0m1.480s

[bpowers_AT_fina ~]$ time find / -regex 'bin' 2>/dev/null
real 0m2.132s
user 0m0.753s
sys 0m1.362s

[bpowers_AT_fina ~]$ find --version | head -1
find (GNU findutils) 4.5.11

The find -regex is consistently about 10% faster. Not much, but also
not > 2x slower like you see on OSX.

yours,
Bobby
Received on Thu Dec 12 2013 - 23:26:46 CET

This archive was generated by hypermail 2.3.0 : Thu Dec 12 2013 - 23:36:06 CET