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

From: Andrew Gwozdziewycz <web_AT_apgwoz.com>
Date: Thu, 12 Dec 2013 17:30:23 -0500

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.



-- 
http://apgwoz.com
Received on Thu Dec 12 2013 - 23:30:23 CET

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