emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVS directories in completion-ignored-extensions


From: Stefan Monnier
Subject: Re: CVS directories in completion-ignored-extensions
Date: Wed, 19 Jan 2005 11:07:23 -0500
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/21.3.50 (gnu/linux)

>> A cheap way to approximate something like that is to keep a `hit' flag
>> indicating whether this cache entry has ever been re-used.  Upon GC remove
>> all entries for which `hit' is false and reset all `hit' flags to false.

> And just reuse entries in the current LRC (least recently compiled)
> way if we reach the hard limit.

Right, and the hard limit can be adjusted after each GC to be N times the
number of entries that the GC preserved.

> We could also optimize this test:

>       if (SCHARS (cp->regexp) == SCHARS (pattern)
>         && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern)
>         && !NILP (Fstring_equal (cp->regexp, pattern))
>           ...

> with this test:

>       if ((EQ (cp->regexp, pattern)
>            || (SCHARS (cp->regexp) == SCHARS (pattern)
>                && STRING_MULTIBYTE (cp->regexp) == STRING_MULTIBYTE (pattern)
>              && !NILP (Fstring_equal (cp->regexp, pattern))))
>           ...

I doubt it'll be very beneficial:
If the entry we're looking for is at position P in the list, the EQ test
will fail at least P-1 times and succeed at most once.

If we want to speed up the case of the reuse of the exact same string
object, we could add a text-property to the string holding the index of the
compiled regexp in searchbufs.


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]