Re: [PATCH v6 20/28] fsmonitor: optimize processing of directory events
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- May 24, 2022, 11:53 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2205241353030.352@tvgsbejvaqbjf.bet>
- In-Reply-To
- <c716b1d6-a0a8-6d03-dfe5-70613e4ed942@jeffhostetler.com>
Hi Jeff,
On Tue, 17 May 2022, Jeff Hostetler wrote:
Show 45 quoted lines
> On 5/12/22 11:08 AM, Johannes Schindelin wrote:
> >
> > On Fri, 22 Apr 2022, Jeff Hostetler via GitGitGadget wrote:
> >
> > > From: Jeff Hostetler <jeffhost@microsoft.com>
> > >
> > > Teach Git to perform binary search over the cache-entries for a directory
> > > notification and then linearly scan forward to find the immediate
> > > children.
> > >
> [...]
>
> > > static void fsmonitor_refresh_callback(struct index_state *istate, char
> > > *name)
> > > {
> > > int i, len = strlen(name);
> > > - if (name[len - 1] == '/') {
> > > + int pos = index_name_pos(istate, name, len);
> > > +
> > > + trace_printf_key(&trace_fsmonitor,
> > > + "fsmonitor_refresh_callback '%s' (pos %d)",
> > > + name, pos);
> > >
> [...]
>
> > > + if (name[len - 1] == '/') {
> [...]
> > > }
>
> > > @@ -215,7 +253,6 @@ static void fsmonitor_refresh_callback(struct
> > > index_state *istate, char *name)
> > > * Mark the untracked cache dirty even if it wasn't found in the index
> > > * as it could be a new untracked file.
> > > */
> > > - trace_printf_key(&trace_fsmonitor, "fsmonitor_refresh_callback '%s'",
> > > name);
> >
> > Did you mean to remove this statement in this patch? Not a big issue, but
> > I wonder what the rationale for it is, and since I have an inquisitive
> > mind, I figured I'd just ask.
>
> I just moved it to the top of the function. That lets me see `name`
> before it is modified in one of the else arms (it was helpful to see
> whether the daemon sent a trailing slash or not). And I also wanted
> to see the computed value of `pos` (before the "-pos - 1" tricks).Oh, I missed that it was moved rather than removed. Sorry for that!
Thank you, Dscho