GNU bug report logs - #63225
Compiling regexp patterns (and REGEXP_CACHE_SIZE in search.c)

Previous Next

Package: emacs;

Reported by: Ihor Radchenko <yantar92 <at> posteo.net>

Date: Tue, 2 May 2023 07:35:02 UTC

Severity: normal

Tags: patch

Full log


Message #92 received at 63225 <at> debbugs.gnu.org (full text, mbox):

From: Mattias EngdegÄrd <mattias.engdegard <at> gmail.com>
To: Ihor Radchenko <yantar92 <at> posteo.net>
Cc: 63225 <at> debbugs.gnu.org
Subject: Re: bug#63225: Compiling regexp patterns (and REGEXP_CACHE_SIZE in
 search.c)
Date: Mon, 8 May 2023 21:53:42 +0200
8 maj 2023 kl. 21.38 skrev Ihor Radchenko <yantar92 <at> posteo.net>:

> Does this imply that simple regexps like
> 
> (looking-at-p (rx (seq bol (zero-or-more (any "\t ")) "#" (or " " eol))))
> 
> should better be implemented as the following?

Obviously this isn't practical or beneficial for any but the simplest patterns. Benchmark if you are concerned.
It is useful to know when (not) to use regexps.

> (I now start thinking that it might be more efficient to create a bunch
> or char tables and step over them to match "regexp", just like any
> finite automaton would)

I wish elisp were fast enough that we could do that in general.

> I really hope that I did not need to do all these workarounds specific to
> current implementation pitfalls of Emacs regexp compiler.

Some of them. We program for the system we have. Emacs is a very slowly moving target.

>> I would like that too, but changing that isn't easy.
> 
> I am sure that it is easy.

I didn't mean technically. Code is easy to write.

> It actually does nothing given that `org-property-re' does not contain
> letters. I will remove it.

It doesn't even matter what org-property-re contains because it isn't used with a changed case-fold-search (which is bound using let, not let*).





This bug report was last modified 2 years and 37 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.