From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers Date: Tue, 13 Dec 2022 13:15:05 -0500 Message-ID: References: <877d10r21x.fsf@localhost> <87zgdwyvkt.fsf@gnus.org> <87ilkk6ri5.fsf@localhost> <87v8okjei9.fsf@gnus.org> <87tu44jdce.fsf@localhost> <87czasjd9j.fsf@gnus.org> <87k050nio5.fsf@localhost> <87zgdwhw0z.fsf@gnus.org> <83sfjo3tfw.fsf@gnu.org> <878rlfjmjh.fsf@localhost> <87mt9tbbbp.fsf@gnus.org> <8335bl18lo.fsf@gnu.org> <87wn8x9eqb.fsf@gnus.org> <87tu1zd2c6.fsf@localhost> <83h6xzphxm.fsf@gnu.org> <87wn6vbfaa.fsf@localhost> <838rjbpecw.fsf@gnu.org> <87fsdjwb4e.fsf@localhost> <83zgbrnv53.fsf@gnu.org> <87bko78aif.fsf@localhost> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="23968"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 58558@debbugs.gnu.org, Eli Zaretskii , larsi@gnus.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Dec 13 19:16:37 2022 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 1p59pU-00063G-Sz for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 13 Dec 2022 19:16:37 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p59p9-0006D9-EA; Tue, 13 Dec 2022 13:16:15 -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 1p59ow-0006AJ-Sz for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 13:16: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 1p59ow-0005LD-LK for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 13:16:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p59ow-0003P0-6X for bug-gnu-emacs@gnu.org; Tue, 13 Dec 2022 13:16:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 13 Dec 2022 18:16:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 58558 X-GNU-PR-Package: emacs Original-Received: via spool by 58558-submit@debbugs.gnu.org id=B58558.167095531513069 (code B ref 58558); Tue, 13 Dec 2022 18:16:02 +0000 Original-Received: (at 58558) by debbugs.gnu.org; 13 Dec 2022 18:15:15 +0000 Original-Received: from localhost ([127.0.0.1]:33792 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p59oB-0003Oj-5V for submit@debbugs.gnu.org; Tue, 13 Dec 2022 13:15:15 -0500 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:64847) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p59o9-0003OZ-Mb for 58558@debbugs.gnu.org; Tue, 13 Dec 2022 13:15:14 -0500 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 42A6744226B; Tue, 13 Dec 2022 13:15:08 -0500 (EST) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id ED813442260; Tue, 13 Dec 2022 13:15:06 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1670955307; bh=lB4F2stHapsDNdbRbG9AJQMdWe/GOW0VpBrSWLBVkd4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=Juj//3/8VM9PWgWMR4fUVI/qr2rOgsD63Sb5gfkuS21F9CpuYC/ak7bbzFArsdWBb 73UvLzHPOoFR1a2zkZ1LrTTCohzyku25Ye0u2WS3G9mzfriHteRgVtYg/Y0JxnkTqg tEfL1ZqR1vL2WltlP/+S9qJ6JnSQ1QqVo0CCyHv4UIpOKAUz/qXW4k04iR4C2ClmLl ZTcJ/mCCQVybh1lY8LgXM2hx4/ACZK469QDbrcfVNOpOh8AwurYot5I606RQrcrGGu uWr2qcLkcHxTdB8FW4E0jPocXi0Jskd8eCXFnIc0Bjsu5ohdRHSEFW7qYUTqOatdjK EdsiQI/V3jkAw== Original-Received: from pastel (unknown [45.72.193.52]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id B173F12022B; Tue, 13 Dec 2022 13:15:06 -0500 (EST) In-Reply-To: <87bko78aif.fsf@localhost> (Ihor Radchenko's message of "Tue, 13 Dec 2022 17:43:36 +0000") 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:250874 Archived-At: > The benchmark itself does not trigger the breakpoint. Does that mean that `Fmatch_data` is not called during a single `re-search-forward` (not a surprise: you'd need to put a breakpoint on `build_marker` to see the markers built by `buf_bytepos_to_charpos`) but is called between `re-search-forward`, or that it's not called at all during the whole benchmark where you perform several `re-search-forward` which grow progressively slower? If it's the latter, then those calls can't explain the slowdown, right? > If I read the backtrace correctly, something in my custom mode-line is > triggering Fmatch_data that creates markers. The most common calls to `match-data` are from `save-match-data`. And most uses of `save-match-data` are ill-advised (as the docstring explains `save-match-data' should be used to save *your* match data rather than your caller's match data), so you might like to double check whether that call to `match-data` can be eliminated altogether. Stefan