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?= Newsgroups: gmane.emacs.bugs Subject: bug#63225: Compiling regexp patterns (and REGEXP_CACHE_SIZE in search.c) Date: Wed, 3 May 2023 15:59:29 +0200 Message-ID: <6DAF37F9-B236-4C33-8E30-0FCA47CCBCC5@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> 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="30572"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 63225@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed May 03 16:00:14 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 1puD1h-0007h1-VK for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 03 May 2023 16:00:13 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1puD1Y-0000Vn-85; Wed, 03 May 2023 10:00:04 -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 ) id 1puD1X-0000VJ-0Q for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 10:00:03 -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 ) id 1puD1W-0002dq-MD for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 10:00:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1puD1W-0005D4-4g for bug-gnu-emacs@gnu.org; Wed, 03 May 2023 10:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Mattias =?UTF-8?Q?Engdeg=C3=A5rd?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 May 2023 14:00:02 +0000 Resent-Message-ID: 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.168312238119964 (code B ref 63225); Wed, 03 May 2023 14:00:02 +0000 Original-Received: (at 63225) by debbugs.gnu.org; 3 May 2023 13:59:41 +0000 Original-Received: from localhost ([127.0.0.1]:47480 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puD1B-0005Bv-Do for submit@debbugs.gnu.org; Wed, 03 May 2023 09:59:41 -0400 Original-Received: from mail-lj1-f171.google.com ([209.85.208.171]:55587) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1puD17-0005Bf-E7 for 63225@debbugs.gnu.org; Wed, 03 May 2023 09:59:40 -0400 Original-Received: by mail-lj1-f171.google.com with SMTP id 38308e7fff4ca-2a8bbea12d7so53786541fa.3 for <63225@debbugs.gnu.org>; Wed, 03 May 2023 06:59:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683122371; x=1685714371; 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=0Pk7WwOLcoQ1WrUNG3nDvmFOmUIL4XxdkipS6ky/YM4=; b=Vu5ZbYBY6QzcfhZE+hGul1o1rsi3a3rVdPFaMXOb5I0cIDqdB6rTYuAYZqWccbNgN2 1pD9zYMHnzoHnwDDH2eZRTkhaJMaAAt9ZSARWTs9Apk2k3QwzfVoJXb1ad3evWZYQZHC 44P6DupqqmRkI+HKi7uyEoRf+BUA7xChOaRa3TiK+oxMiDXmRe8qTMqiic0uJ29EZa/7 HlArx7NQzazrOy8LnupMZ16pbAIm2EjFR2EA4bpaVDzVZXnFcy00flFo5wP17p9fm2mb /L0/2MviuvSu1nR8W4j491w37bz0/6YbLzaO3orGRYPN3vVyd/Qj8NYKBXQefNSXUBoH hMCQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683122371; x=1685714371; 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=0Pk7WwOLcoQ1WrUNG3nDvmFOmUIL4XxdkipS6ky/YM4=; b=DgoweiUlcV0St34/FxgasD6e++MFhutXlkvsycAXBcRCQNy+GG+HrnoIAfkuZjLtDc YGj/VUw6ZVh5RsQlHNHxWuSlMZTrZFuRFnT5LAf8QYqjq+wyhUK3FXZ4jRljSbYUj9ri MABpm8QvAH02juc9fDmlisVcKKAW638hQJRSXtW/ckKhjIbDWBiXOKzbs9PByp/uX6tt 0CQDQtcIdoQTeNpDrriUoAiceJgBaoLPMSbM/HhjR4e00IjCwPbaSKkRK1rgSY++yPUt wBt2ZcBtc8ep49IKSxkdIzCERpQys6BWpKdMsYJg3kxhdq2E6hjFfLR46RNX2LJKSRdr uWjw== X-Gm-Message-State: AC+VfDxL9MQVytK5IRJSQ/bjtvxiNWu5BvtkdZqOz2AxLjRRdyNQrc1i IEm9ip8w7mf76chD88x30+o= X-Google-Smtp-Source: ACHHUZ5gBuQPz/kKWWdjNvc+jOdxNc/4X3z2iaM5b9tsoGqdah4sPpOt/VcJb0xWtqrvxMsi75w1Hw== X-Received: by 2002:a2e:9149:0:b0:2a8:a6a9:4303 with SMTP id q9-20020a2e9149000000b002a8a6a94303mr73126ljg.8.1683122371234; Wed, 03 May 2023 06:59:31 -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 u17-20020a2e9b11000000b00293d7c95df1sm5977159lji.78.2023.05.03.06.59.30 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 03 May 2023 06:59:30 -0700 (PDT) In-Reply-To: <87wn1psqny.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" 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:260979 Archived-At: 3 maj 2023 kl. 11.36 skrev Ihor Radchenko : > 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.