Re: [dev] alternatives to find for querying the filesystem
On Thu, Dec 12, 2013 at 5:30 PM, Andrew Gwozdziewycz <web_AT_apgwoz.com> wrote:
> On Thu, Dec 12, 2013 at 5:26 PM, Bobby Powers <bobbypowers_AT_gmail.com> wrote:
>> 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.
>>
>
> Let me retry killing the output as fast as possible as you did.
I still get something quiet equivalent, though this time it was 14s to
10s, so it doesn't appear to be console slowness. find is apparently
just bad on OSX. BTW, there's no version or help flag for this find.
That should say something about it.
Received on Thu Dec 12 2013 - 23:34:04 CET
This archive was generated by hypermail 2.3.0
: Thu Dec 12 2013 - 23:36:17 CET