From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.bugs Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers Date: Sun, 09 Apr 2023 19:54:49 +0000 Message-ID: <87lej0zv92.fsf@localhost> References: <877d10r21x.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> <874jtyuqax.fsf@localhost> <83zgbqm8q6.fsf@gnu.org> <87sfhit8ug.fsf@localhost> <83tu1ym6jo.fsf@gnu.org> <87h6xyt77x.fsf@localhost> <87h6ttkz6n.fsf@localhost> <838rf5qkpt.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37094"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58558@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Apr 09 21:53:17 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 1plb6D-0009Tj-2S for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 09 Apr 2023 21:53:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plb60-0007YU-Vj; Sun, 09 Apr 2023 15:53:05 -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 1plb5y-0007YC-VI for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 15:53:02 -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 1plb5y-0004Fc-N0 for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 15:53:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plb5x-0005r0-Vu for bug-gnu-emacs@gnu.org; Sun, 09 Apr 2023 15:53:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Ihor Radchenko Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 09 Apr 2023 19:53:01 +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.168106996222470 (code B ref 58558); Sun, 09 Apr 2023 19:53:01 +0000 Original-Received: (at 58558) by debbugs.gnu.org; 9 Apr 2023 19:52:42 +0000 Original-Received: from localhost ([127.0.0.1]:33834 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plb5d-0005qM-Tw for submit@debbugs.gnu.org; Sun, 09 Apr 2023 15:52:42 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:51629) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plb5c-0005q4-0H for 58558@debbugs.gnu.org; Sun, 09 Apr 2023 15:52:40 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 014B2240175 for <58558@debbugs.gnu.org>; Sun, 9 Apr 2023 21:52:33 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1681069954; bh=Oy2jBb/twwYiig0E6o5hoJuw8RLGXM59M6Pz0b4dF/8=; h=From:To:Cc:Subject:Date:From; b=KtMz8PyiePHvuUMgGOqGrWVLnAyuh5SiJBuJZ9iwvNwC7anRDSngNHCjFmZjOtuvA Rl4eiXGl5dwcR77TL3NA37GZkg+YOTDDX38knFq22pSZ4CYET50teiCt7rtdjzL0+Y U53Rk7sc4g1fDYbqgS3sOpKcBANZX8uPBQfgRXvc0DY2m72lWgm3I0o2X4/NCY+VCV f0CBMsEK5yi13trw/alzVeCSIzLfJ5wE5weZPn5mBfqY0uktwz6+mqDKa4RPU2WBgv FV+rZ8Yco3b1HzX6eZpxIrolv8Xui5uvGw6fXC3cnrdL56rpdhiWeND1rCI5NhKaRB tuVsw2EsKj1wA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4PvjSK0Htbz6tv5; Sun, 9 Apr 2023 21:52:32 +0200 (CEST) In-Reply-To: <838rf5qkpt.fsf@gnu.org> 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:259537 Archived-At: Eli Zaretskii writes: > I think we should first go back to using perf. I don't think you > compared profiles for Emacs which just started with one that was > running long enough to show the slowdown. Comparing such profiles > should at least give us a hint where to look. I now tried perf record -g. I was able to narrow down the call tree of the problematic buf_bytepos_to_charpos calls: 43.82%--Fre_search_forward --43.81%--search_command --43.78%--search_buffer --43.78%--search_buffer_re --43.33%--re_search_2 --36.39%--re_match_2_internal --21.90%--SYNTAX_TABLE_BYTE_TO_CHAR --21.57%--BYTE_TO_CHAR --21.49%--buf_bytepos_to_charpos Not sure if it is telling much. I also looked into git history and I can only identify significant changes in re_match_2_internal after Emacs 28 release. -- Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at