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: Thu, 4 May 2023 11:24:34 +0200
Message-ID: <878E8D66-A548-42E6-B077-6068A8B131D8@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>
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="30553"; 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 Thu May 04 11:25:30 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 1puVDN-0007gi-Ka
	for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 04 May 2023 11:25: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 1puVDB-0007nW-DA; Thu, 04 May 2023 05:25:17 -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 1puVD8-0007mV-Vx
 for bug-gnu-emacs@gnu.org; Thu, 04 May 2023 05:25:15 -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 1puVCw-0008U8-Fz
 for bug-gnu-emacs@gnu.org; Thu, 04 May 2023 05:25:14 -0400
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1puVCw-0002YM-5t
 for bug-gnu-emacs@gnu.org; Thu, 04 May 2023 05:25:02 -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: Thu, 04 May 2023 09:25:02 +0000
Resent-Message-ID: <handler.63225.B63225.16831922839780@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.16831922839780
 (code B ref 63225); Thu, 04 May 2023 09:25:02 +0000
Original-Received: (at 63225) by debbugs.gnu.org; 4 May 2023 09:24:43 +0000
Original-Received: from localhost ([127.0.0.1]:48567 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1puVCd-0002Xf-9f
 for submit@debbugs.gnu.org; Thu, 04 May 2023 05:24:43 -0400
Original-Received: from mail-lj1-f176.google.com ([209.85.208.176]:61602)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <mattias.engdegard@gmail.com>) id 1puVCb-0002XS-IG
 for 63225@debbugs.gnu.org; Thu, 04 May 2023 05:24:42 -0400
Original-Received: by mail-lj1-f176.google.com with SMTP id
 38308e7fff4ca-2a8afef50f2so2801771fa.2
 for <63225@debbugs.gnu.org>; Thu, 04 May 2023 02:24:41 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1683192275; x=1685784275;
 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=ltzJDtz61HSK57E1ta3j2HDi96xPcohHrxp2zVlO3T8=;
 b=h2EzRZbo3riZ09KqoQVlQ9yEXXqFdRjcIkcditgiIngek14+/RLe++yDaIoIKPanYt
 DkIu4xtQAuAG/ii6Fj1Yw73xTgY4DEhwG/uUhIpCqWTX8Lpb/4V9hrFFWhwbv+Ya8Bq6
 o26M7xk8bqBgFu7bC08UFUicONHU2UTo4KU1Jf162yPWnQwNlFgVdno73OSqvpUtBKjf
 Je3r3VEYLzaHDfQSMRrBrPcW9aM1yWIJewpwRNgZ9TqU9BBIGPb4PjU8zx7W4+W4UQc6
 4+xEG7owfwA8IWRc9c0qmbkhPKwhh6mwXgZBFZJoqfnZsebfzLHI10iTRz7JtInTyyZw
 7BgA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1683192275; x=1685784275;
 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=ltzJDtz61HSK57E1ta3j2HDi96xPcohHrxp2zVlO3T8=;
 b=I0aY6CfbFVk3Ih7fe8wII2O8C9xUlrQaVLFLJIlQtaXvh8adkyMyx5VyMQklNyO3+t
 RJtiouDsiuXik9d7CY0QdTjxH3sicxH3uqt1/rPW5RjVX6rGkFkN8/M3olZQtOZfuPsK
 LjbgtBfos47+QPpX34hPgbc+dzb6Kf8te6VGUuaKToMiIVXgQUC+JdW9I1iMrEFz4+o7
 o1l+C9m8YeDMl4FI6B7gkut7I7WPhqQspE+IMf5RUQk64XvdjyL5qulbboHRMFtB5K3a
 f+08sw1z8Azk+XnLCrtyOvLH9vumn6NBqEyk9GyM+acVa24Ru4v+ddl22nhlLvTRAKEi
 o7Vw==
X-Gm-Message-State: AC+VfDyNm/QC2kqUuaYI5lNnHxzak28vssYabf2201qCXL0Prje6vOi+
 aZdfO5NzMYQ+i/tlaYarv0Q=
X-Google-Smtp-Source: ACHHUZ47ctrCJjKoOUbD4dCOCAbD0MS+C6khAwD8d8vSzYi/HtAWF29TNJ7t3WviXXNoWXZ7vLlQ8g==
X-Received: by 2002:a2e:9bc3:0:b0:295:8fd5:da00 with SMTP id
 w3-20020a2e9bc3000000b002958fd5da00mr1060491ljj.22.1683192275479; 
 Thu, 04 May 2023 02:24:35 -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
 e17-20020a2e9851000000b002a8c2a4fe99sm6484032ljj.28.2023.05.04.02.24.34
 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128);
 Thu, 04 May 2023 02:24:34 -0700 (PDT)
In-Reply-To: <87o7n1v1w3.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:261006
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/261006>

3 maj 2023 kl. 18.02 skrev Ihor Radchenko <yantar92@posteo.net>:

> What is the aim of instrumenting regexp engine in this scenario?
> I already know that additional regexps will be tested by individual
> `org-element-X-parser' functions.

I got the impression that the 'spine' of the parser, the sequence of =
`looking-at` calls in `org-element--current-element`, would frequently =
be run through in its entirety which means that consolidating these =
would reduce the number of working regexps by about 20 (if I'm counting =
correctly).

Now if as you suggest the parsing is dominated by sequences of regexps =
in the branches, it prompts the questions: which branches, what regexps, =
why are there so many of them, and is there anything that can be done to =
reduce their number?

> I am also not sure how to instrument the regexp engine and what I can
> see there.

Sorry, it is just what I who know nothing about the structure of Org =
would do to get a better view. You may find it easier to work at the =
Lisp level.