On 02/02/2023 08:34, Eli Zaretskii wrote: >> Date: Wed, 1 Feb 2023 23:20:50 +0200 >> Cc:casouri@gmail.com,60953@debbugs.gnu.org >> From: Dmitry Gutov >> >> On 01/02/2023 15:39, Eli Zaretskii wrote: >>>> Please see the attachment. >>>> >>>> To note the numbers: the first patch does quite well to improve the >>>> performance of modes which use :match in queries which match a lot of >>>> nodes (e.g. rust-ts-mode or ruby-ts-mode). There boost in those was on >>>> the order of 25%. >>>> >>>> The second one is longer, and the boost (on top of the first one) is >>>> around 5-6%, stable. Not as impressive, but at least it brings :match's >>>> performance a little above :pred's in my example. >>> Fine by me, if Yuan also approves. >> For emacs-29, right? > Yes. Please take a look at this additional patch on top of the other one. It is ok? I just remembered that if we don't want to auto-anchor the regexp, then 'looking-at' is not the appropriate semantic. So this switches to 'search_buffer'.