:: Re: [DNG] mouse driver question
Etusivu
Poista viesti
Vastaa
Lähettäjä: Antony Stone
Päiväys:  
Vastaanottaja: dng
Uudet otsikot: [DNG] Piping is an easy way to do multithreading: was mouse driver question
Aihe: Re: [DNG] mouse driver question
On Saturday 23 April 2022 at 22:57:12, Florian Zieboll via Dng wrote:

> On Sat, 23 Apr 2022 21:15:34 +0200 Antony Stone wrote:
> > On Saturday 23 April 2022 at 21:11:18, Florian Zieboll via Dng wrote:
> >
> > > Some time ago, in a similar situation, I had been successful with
> > >
> > > $ find / | grep xorg.conf
> >
> > Personally I'd have gone for:
> >     find / -name xorg.conf

>
> I may be wrong (and nitpicking;) - but I think that your approach is
> less fast, as 'find' does the file name matching /before/ it continues
> searching - in opposite to just piping its output to grep and going on
> with running down the file system hierarchy without any interruption.


Interesting - and you're right.

I just tried several successive searches for a few unique filenames in a
directory tree (all files in the same directory, just in case the position made
a difference).

The first search took 6 minutes and clearly set up some cache of results,
because subsequent searches were consistently:

    find . | grep filename : 20 seconds


    find . -name filename : 25 seconds


That was consistent no matter whether the two filenames were the same, or
different but still in the same directory, and no matter which command was run
first.

Nice observation.


Antony.

--
The more 'success' you get, the easier it is to be disappointed by not getting
things.
The only difference is that now no-one feels sorry for you.

- Matt Haig

                                                   Please reply to the list;
                                                         please *don't* CC me.