Subject: bug#63225: Compiling regexp patterns (and REGEXP_CACHE_SIZE in search.c)

From: Mattias Engdegård <[email-masked]>
Date: Wed, 3 May 2023 15:59:29 +0200

3 maj 2023 kl. 11.36 skrev Ihor Radchenko <[email-masked]>:

> Yet, in my tests, I am unable to see any improvement when I consolidate
> the regexps.

That's odd, but do you get a better cache hit rate (assuming a cache size of 20)?

> The version with giant single rx form is actually slower overall (!),
> making no difference at all in `org-element--current-element'.

Can't say what's going on here, really. Normally a combined regexp shouldn't be slower. Are you sure you get the same parse?

> Ideally, the compiler should do something similar to
> what https://www.colm.net/open-source/ragel/ does.

Yes, constructing a DFA would be more realistic when it's less in danger of being thrown away at any time.