unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: storm@cua.dk (Kim F. Storm)
Cc: miles@gnu.org, emacs-devel@gnu.org, Kenichi Handa <handa@m17n.org>
Subject: Re: CVS directories in completion-ignored-extensions
Date: Wed, 19 Jan 2005 16:52:28 +0100	[thread overview]
Message-ID: <m33bwxh0w3.fsf@kfs-l.imdomain.dk> (raw)
In-Reply-To: <87hdldbhi6.fsf-monnier+emacs@gnu.org> (Stefan Monnier's message of "Wed, 19 Jan 2005 09:57:04 -0500")

Stefan Monnier <monnier@iro.umontreal.ca> writes:

>> To me it seems like the regexp cache could be improved by
>> keeping a usage counter and a lru timestamp so frequently
>> used regexps could be kept in the cache -- and the cache
>> could grow dynamically to always hold the most frequently
>> used regexps [with some hard upper limit of course].
>
> 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.

>
> I.e. only those entries that have been reused since the last GC survive.
>
>> E.g. if I have a large number of regexps to split mail in gnus,
>> it would be nice to keep all of those in the cache.
>
> But of course a larger cache means slower lookup.

We can optimize that quite a bit, e.g. by hashing on SCHARS (pattern).

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))))
          ...

--
Kim F. Storm <storm@cua.dk> http://www.cua.dk

  reply	other threads:[~2005-01-19 15:52 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-12-30  8:01 CVS directories in completion-ignored-extensions Eli Zaretskii
2003-12-30 23:44 ` Eric Hanchrow
2003-12-31  1:08   ` Luc Teirlinck
2003-12-31  1:34     ` Miles Bader
2003-12-31  5:51       ` Eli Zaretskii
2004-01-01  5:49       ` Eli Zaretskii
2004-01-01 21:10         ` Richard Stallman
2004-01-02  0:31           ` Miles Bader
2004-01-02  1:06           ` Kim F. Storm
2004-01-02  9:21             ` Eli Zaretskii
2004-01-03 11:52             ` Eli Zaretskii
2004-01-04 18:53               ` Richard Stallman
2004-01-04 23:17                 ` Stefan Monnier
2004-01-04 23:59                   ` Miles Bader
2004-01-05 17:56                     ` Richard Stallman
2004-01-06  0:08                       ` Miles Bader
2004-01-06  0:52                         ` Kenichi Handa
2004-01-06  1:54                           ` Miles Bader
2004-01-06  3:00                             ` Kenichi Handa
2005-01-19 11:34                               ` Kim F. Storm
2005-01-19 14:57                                 ` Stefan Monnier
2005-01-19 15:52                                   ` Kim F. Storm [this message]
2005-01-19 16:07                                     ` Stefan Monnier
2004-01-06  5:55                         ` Eli Zaretskii
2004-01-06  6:26                           ` Miles Bader
2004-01-07  2:40                         ` Richard Stallman
2004-01-01 21:27         ` Kim F. Storm

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m33bwxh0w3.fsf@kfs-l.imdomain.dk \
    --to=storm@cua.dk \
    --cc=emacs-devel@gnu.org \
    --cc=handa@m17n.org \
    --cc=miles@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).