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: Mon, 10 Apr 2023 10:27:32 -0400 Message-ID: References: <877d10r21x.fsf@localhost> <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> <83ttxol6f5.fsf@gnu.org> <87h6tolybs.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="16434"; 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 Mon Apr 10 16:28:33 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 1plsVS-00043G-Hs for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Apr 2023 16:28:30 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1plsV6-0000X0-Lm; Mon, 10 Apr 2023 10:28:08 -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 1plsV1-0000WC-Qd for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:28:04 -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 1plsV0-0003PK-Vw for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:28:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1plsV0-0003RJ-Rq for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2023 10:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Apr 2023 14:28: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.168113686213160 (code B ref 58558); Mon, 10 Apr 2023 14:28:02 +0000 Original-Received: (at 58558) by debbugs.gnu.org; 10 Apr 2023 14:27:42 +0000 Original-Received: from localhost ([127.0.0.1]:35594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plsUg-0003QB-Gl for submit@debbugs.gnu.org; Mon, 10 Apr 2023 10:27:42 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:8973) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1plsUf-0003Pw-5o for 58558@debbugs.gnu.org; Mon, 10 Apr 2023 10:27:41 -0400 Original-Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 775481000C4; Mon, 10 Apr 2023 10:27:35 -0400 (EDT) Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 2CEAE1000BE; Mon, 10 Apr 2023 10:27:34 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1681136854; bh=Lx8k4/zGWtFVsvueEpSKTQzoZpBAY9gsWRVF2DGiHrg=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=AuF33aASMLKkvic7svCajQpZBuyf9FpsVF3uCQ8u+IkPYTT9gDLftw3Z6FbNWAhHD S/4W6/mLLCyfDy82lxbfkSqXs/cwy5rAtmfQWVsTtEWrsuTp6+DLnmBlIjcE250/o0 3bUBfRDlziTlBelidHYeMhgyoHLAbpD/gKoVdAFhHe608QV7e1NvmapNzCBxxeIRKp rbg8DqQHnnHjFFMGP2d6aeQogkDlFvD7OlOSegE765YyMWzLtS50KCjHykn1zgRDZH vZk7RQkY+hhVw19h/3eqxleKQZDhuvJQutJi0GgMyG5PEz+JclO9hrnA3J5j7GgHAQ /IwpHVlXK1g0Q== Original-Received: from pastel (unknown [45.72.217.176]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ED795123208; Mon, 10 Apr 2023 10:27:33 -0400 (EDT) In-Reply-To: <87h6tolybs.fsf@localhost> (Ihor Radchenko's message of "Mon, 10 Apr 2023 12:24:23 +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:259580 Archived-At: >>> 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? > "fast" (emacs 28) session does not have this call tree contributing > significantly. And I thought, we already established around Dec 13 that most of the time is spent in `buf_bytepos_to_charpos` (in other profiles). > Unless there is some other place in buf_bytepos_to_charpos that may be > slow, the only possible explanation is that it simply gets called more > times. That would be quite surprising. BTW, when debugging such performance problem, I often resort to a few `DEFVAR_INT` defining ad-hoc counter variables, then sprinkle corresponding increments of those variables from various places (typically function entry point, loops, ...). That gives me a kind of "poor man's profiler", but with the advantage that I can look at their value conveniently from within the affected Emacs session. Stefan