From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#58558: 29.0.50; re-search-forward is slow in some buffers Date: Mon, 10 Apr 2023 07:14:54 +0300 Message-ID: <83ttxol6f5.fsf@gnu.org> 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> <87lej0zv92.fsf@localhost> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6133"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 58558@debbugs.gnu.org, larsi@gnus.org, monnier@iro.umontreal.ca To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Apr 10 06:15:25 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 1pliw9-0001OH-6h for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 06:15:25 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plivq-00035u-N7; Mon, 10 Apr 2023 00:15:06 -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 1plivn-00035d-7Z for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 00:15: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 1plivm-0005Fi-Hu for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 00:15:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plivl-00035c-St for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 00:15:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2023 04:15: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.168110006711821 (code B ref 58558); Mon, 10 Apr 2023 04:15:01 +0000 Original-Received: (at 58558) by debbugs.gnu.org; 10 Apr 2023 04:14:27 +0000 Original-Received: from localhost ([127.0.0.1]:34028 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plivC-00034b-Tw for submit@debbugs.gnu.org; Mon, 10 Apr 2023 00:14:27 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43262) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pliv8-00034M-R3 for 58558@debbugs.gnu.org; Mon, 10 Apr 2023 00:14:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pliv2-0005Bp-Kk; Mon, 10 Apr 2023 00:14:16 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=TTQLNvmP5lozTaIQVaWM3RDyhCrZYhqwlQbizpAMGt4=; b=q9ssCfrYQ8f3 QfY7UJF0jepv5wt5o/fSIvf3zMSv7LPqJAINzmz1IA3I4+e/o5XaHJOQgcEg80pEPk0LukmKQ5XQ6 nHtfReayuoO2RurjZaN+GdW4kgAlFd5cnvptVC7xhQlbods/C6GPBVhiBvlAAEzuz5SZgCP3e/oHT BVNAIZF3qB9dO9A5QRz+Zr2S6WbLAg2kXQIDHphwHwsFiIn3w95OSHgWJitZg7+Mc3WrSBGBoO45z tAUv3XOvCYLaYeo1S8l47b2aIZEEFH8EHwG2aSM3vTX6saN56rR4UjxjSxNnNm9L1iTZMJNtNa8lK Lm7jEngRruDp3sdTBdFhlQ==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pliv1-0003Xq-Th; Mon, 10 Apr 2023 00:14:16 -0400 In-Reply-To: <87lej0zv92.fsf@localhost> (message from Ihor Radchenko on Sun, 09 Apr 2023 19:54:49 +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:259546 Archived-At: > From: Ihor Radchenko > Cc: monnier@iro.umontreal.ca, larsi@gnus.org, 58558@debbugs.gnu.org > Date: Sun, 09 Apr 2023 19:54:49 +0000 > > 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. How does this compare with a "fast" session doing the same? And why are you once again focusing on buf_bytepos_to_charpos, when you previously (presumably) established that it cannot be the problem, since the number of markers doesn't change significantly? > I also looked into git history and I can only identify significant > changes in re_match_2_internal after Emacs 28 release. It sounds like most of the time is not in re_match_2_internal itself. But I think comparison with a "fast" session could help with ideas. Thanks.