From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#60953: The :match predicate with large regexp in tree-sitter font-lock seems inefficient Date: Thu, 02 Feb 2023 16:23:10 +0200 Message-ID: <835yckxi29.fsf@gnu.org> References: <7624dddc-4600-9a03-ac8b-d3c9e0ab618c@yandex.ru> <838rhpg57n.fsf@gnu.org> <5026D975-983F-4D18-8690-BE139C92825D@gmail.com> <83pmb1emxi.fsf@gnu.org> <6f318afc-ca71-8b7e-c822-52e6635b5718@yandex.ru> <83sffxcfxw.fsf@gnu.org> <83pmb1cbg5.fsf@gnu.org> <2da844d3-ea31-289e-2821-aa174e365ffd@yandex.ru> <6784f9e7-844b-374d-2a1e-8a61cebe0d7e@yandex.ru> <83zga03yne.fsf@gnu.org> <373a575f-c683-1581-c3e6-502e9897fb04@yandex.ru> <83mt603vrc.fsf@gnu.org> <83e58a1b-2e4a-356a-36d8-c756ff105b62@yandex.ru> <83bkmf52va.fsf@gnu.org> <33cad4c1-4af5-37bb-05bc-79a4d9c1a700@yandex.ru> <83wn533lut.fsf@gnu.org> <19892f55-498e-1109-2229-2ddd984849a4@yandex.ru> <83tu073ksp.fsf@gnu.org> <83sffr2xq2.fsf@gnu.org> <30b047a9-dfe3-948a-a123-2e15221c239d@yandex.ru> <83tu05zeqe.fsf@gnu.org> <957c7e3e-830e-0a03-562f-fdddc6bd1c06@yandex.ru> <835yckzic7.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="29870"; mail-complaints-to="usenet@ciao.gmane.io" Cc: casouri@gmail.com, 60953@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Feb 02 15:24:23 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pNaVi-0007Yd-HU for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 02 Feb 2023 15:24:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pNaVP-00035E-LQ; Thu, 02 Feb 2023 09:24:03 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNaVO-00034D-Fh for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 09:24:02 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pNaVO-0002V6-7X for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 09:24:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pNaVO-0003gp-2A for bug-gnu-emacs@gnu.org; Thu, 02 Feb 2023 09:24:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 02 Feb 2023 14:24:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 60953 X-GNU-PR-Package: emacs Original-Received: via spool by 60953-submit@debbugs.gnu.org id=B60953.167534780014126 (code B ref 60953); Thu, 02 Feb 2023 14:24:02 +0000 Original-Received: (at 60953) by debbugs.gnu.org; 2 Feb 2023 14:23:20 +0000 Original-Received: from localhost ([127.0.0.1]:32965 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNaUh-0003fl-Or for submit@debbugs.gnu.org; Thu, 02 Feb 2023 09:23:20 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:50006) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pNaUf-0003fZ-Re for 60953@debbugs.gnu.org; Thu, 02 Feb 2023 09:23:18 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNaUa-0002PC-9P; Thu, 02 Feb 2023 09:23:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=Flr0O/0/n76ltkxUxo05RqtROYo37KF/Hc8/dykgUCs=; b=gK2CWsuqg+td ZI+qwtP7wnhWhiBPt/401V0eA5f1meppSqCkKtKdzbexXgzQhqX/CZFS4V0ZG5JKhp8e6S6hVlN3O XP03pm9gB/RCxv1CIx2omey2GQYkSnL27AGS01USPPISRKGjvgCZAUsp2qBHUMMSoqurATqhQ5D3F /N1B+fS4QYakGlBNfch4YpixRUD6twvYdI0/WJdLtoa2t9eE7cOC7sKjUVl07bfAlLLBVGYdNM7p2 voEcR7QjfjfU4nsBPWih4aYtOIOvhRoPwEQD7LnlfeM/La4cb40ZEuAL0FZ6ejZxpHcWFfN+vDZma GaFMHwLjrxlWUdhXh3MesQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pNaUW-0001Kt-Dk; Thu, 02 Feb 2023 09:23:09 -0500 In-Reply-To: (message from Dmitry Gutov on Thu, 2 Feb 2023 14:12:54 +0200) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:254655 Archived-At: > Date: Thu, 2 Feb 2023 14:12:54 +0200 > Cc: casouri@gmail.com, 60953@debbugs.gnu.org > From: Dmitry Gutov > > 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'. One gotcha: fast_looking_at returns the length of the match, whereas search_buffer returns the buffer position where it matched. Shouldn't this need a different handling of the return value?