From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@gmail.com>
Newsgroups: gmane.emacs.bugs
Subject: bug#63225: Compiling regexp patterns (and REGEXP_CACHE_SIZE in
 search.c)
Date: Tue, 9 May 2023 17:05:47 +0200
Message-ID: <83EDC4A9-5F1F-4A75-8271-BAFCC8943E53@gmail.com>
References: <63882A45-BD02-40D5-92FA-70175267BA3B@acm.org>
 <874jou7lsf.fsf@localhost> <37EED5F9-F1FE-46B6-B4FA-0B268B945123@gmail.com>
 <87wn1qqvj0.fsf@localhost> <34F4849A-CB39-4C96-9CC1-11ED723706DA@gmail.com>
 <87wn1psqny.fsf@localhost> <6DAF37F9-B236-4C33-8E30-0FCA47CCBCC5@gmail.com>
 <87zg6lfobh.fsf@localhost> <281B22C2-CD69-4495-A97C-E754446CA9A6@gmail.com>
 <87o7n1v1w3.fsf@localhost> <878E8D66-A548-42E6-B077-6068A8B131D8@gmail.com>
 <87ednvul22.fsf@localhost> <EFFDF31B-2B58-44E8-9B05-6039A98331D3@gmail.com>
 <87y1m1oa01.fsf@localhost> <74CD5EF4-5424-40BA-8F80-D0FD89CB890F@gmail.com>
 <87zg6fjar6.fsf@localhost> <C037659A-DBF7-4071-A54F-84CC1D7D18AF@gmail.com>
 <875y923964.fsf@localhost> <67AAB661-8B27-4D09-BF0D-6B76ABB54477@gmail.com>
 <871qjp1zn8.fsf@localhost>
Mime-Version: 1.0 (Mac OS X Mail 14.0 \(3654.120.0.1.15\))
Content-Type: text/plain;
	charset=us-ascii
Content-Transfer-Encoding: quoted-printable
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="4492"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 63225@debbugs.gnu.org
To: Ihor Radchenko <yantar92@posteo.net>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 09 17:06:29 2023
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1pwOv7-0000y5-1H
	for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 09 May 2023 17:06:29 +0200
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1pwOuw-0001ZD-7D; Tue, 09 May 2023 11:06:18 -0400
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1pwOuj-0001X0-L3
 for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 11:06:07 -0400
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 <Debian-debbugs@debbugs.gnu.org>)
 id 1pwOug-0005Xx-HO
 for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 11:06:05 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1pwOuf-00047N-Rb
 for bug-gnu-emacs@gnu.org; Tue, 09 May 2023 11:06:01 -0400
X-Loop: help-debbugs@gnu.org
Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= <mattias.engdegard@gmail.com>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Tue, 09 May 2023 15:06:01 +0000
Resent-Message-ID: <handler.63225.B63225.168364476015821@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 63225
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 63225-submit@debbugs.gnu.org id=B63225.168364476015821
 (code B ref 63225); Tue, 09 May 2023 15:06:01 +0000
Original-Received: (at 63225) by debbugs.gnu.org; 9 May 2023 15:06:00 +0000
Original-Received: from localhost ([127.0.0.1]:44139 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1pwOud-000477-KW
 for submit@debbugs.gnu.org; Tue, 09 May 2023 11:05:59 -0400
Original-Received: from mail-lf1-f45.google.com ([209.85.167.45]:60675)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@gmail.com>) id 1pwOua-00046o-DT
 for 63225@debbugs.gnu.org; Tue, 09 May 2023 11:05:57 -0400
Original-Received: by mail-lf1-f45.google.com with SMTP id
 2adb3069b0e04-4f14ec8d72aso4729508e87.1
 for <63225@debbugs.gnu.org>; Tue, 09 May 2023 08:05:56 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1683644750; x=1686236750;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:from:to:cc:subject
 :date:message-id:reply-to;
 bh=yGRULUaHPZro32JEMz/DvJ/OMtTsLYEsLqrNO8mx8KA=;
 b=KfmOHF7B5HB9dMeegxLNWitFqttMERNJ8HExyTSEoEeb1/fUO+GkT1UVHfeLTaudS6
 2Bj0VtwHkFpedQadhsIzgymxJWMqqSF+Qj766UdZM5Rftb4kd114fIIEGEEuUYe3mmTR
 y2oEh3tszehUbItjIcM4emgWbWwBTA38vHXUVGrbXiuC4U8Gwohq83tB/r5dEJZmMf49
 b4PQjVRcHdRVroxwXeCVf+2UxDZ1WqY7W2ugip5St131buU5IYJvE6Po+8es30eZ88Aj
 uBaO93Yc4paLx5HMNVSl12pRHMp8dcr20uO+lUdYfavcdK+DMyfFSHIo8isdAW5PDJUq
 b19A==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1683644750; x=1686236750;
 h=to:references:message-id:content-transfer-encoding:cc:date
 :in-reply-to:from:subject:mime-version:sender:x-gm-message-state
 :from:to:cc:subject:date:message-id:reply-to;
 bh=yGRULUaHPZro32JEMz/DvJ/OMtTsLYEsLqrNO8mx8KA=;
 b=PRJ8w5dl2PMKIskip2Pl8uV2fmTYl5mgrxHTES5x01dTAfPulnNwsfDZLVZDJv9Vgs
 VLdVj9WEi7X/0jzqD5j7nXN9+e03DZ9el5uW43LlQ3usM8+4AHFpJA0Bf80vz+IDAXfS
 BSGH6fnslgzC0v6qnUJzDVpSYVixR3Y30iY1ZFzj1icnAzdeGiwX03dFZeOcK3UmDQnH
 sHie8hZWYdvAHN1dKeEBSXy3cEXufFfXp9J5carS9GOG1/oSGECxhIkbD2G236GUfUFO
 duvLycvreg1uVHs9Quf/KLgrK4WpxqKDQ/pMJaFecNJ61Wz8aNtj7fz05ICJ9jdQjaey
 vtnA==
X-Gm-Message-State: AC+VfDyCluarA+bmTir0hbusyB4efDmU5TkLPYmTMW4uAH5zTAGPf3BM
 6VkwgoTZ5BHssbE/QjaWGWM=
X-Google-Smtp-Source: ACHHUZ4a9qHFvTfL/FhbQ3/6MY4SkFhRaCmvu2MKmAMgq/3ZRZ3cy5sELyMCHDIMAT3o72UnW9O9Yg==
X-Received: by 2002:ac2:50d3:0:b0:4f0:80:d0c0 with SMTP id
 h19-20020ac250d3000000b004f00080d0c0mr881499lfm.63.1683644749853; 
 Tue, 09 May 2023 08:05:49 -0700 (PDT)
Original-Received: from smtpclient.apple (c188-150-165-235.bredband.tele2.se.
 [188.150.165.235]) by smtp.gmail.com with ESMTPSA id
 u20-20020ac248b4000000b004edca9174bbsm376698lfg.148.2023.05.09.08.05.48
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Tue, 09 May 2023 08:05:48 -0700 (PDT)
In-Reply-To: <871qjp1zn8.fsf@localhost>
X-Mailer: Apple Mail (2.3654.120.0.1.15)
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:261418
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/261418>

9 maj 2023 kl. 14.02 skrev Ihor Radchenko <yantar92@posteo.net>:

> - forward-line + skip-chars-forward      :: (2.980 2 0.648)
> - beginning-of-line + looking-at-p       :: (7.189 2 0.653)
> - beginning-of-line + skip-chars-forward :: (6.833 2 0.634)
> - forward-line + looking-at-p            :: (3.180 2 0.663)

Thanks for measuring. (The regexp cache usage is a secondary cost to =
looking-at-p that isn't covered by your benchmark.)

You may want to try the small improvement to skip-chars-forward that =
just arrived on master.

> Will it make sense to use a combination of char-after and
> skip-chars-forward every single time?

Maybe, depending on how complex that combination would be. Applications =
under regexp cache pressure (like Org) may gain more from it, but of =
course it's also a question of programming convenience.

> May you elaborate what is the blocker then?

Mostly time, but also coming up with a design that is compatible and =
reasonably future-safe, and convincing people that it's a good way =
forward (assuming it actually is). Emacs is a collaborative effort, =
after all.