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#71644: 30.0.50; Severe slowdown in larger files with markers beginning in emacs 29+ Date: Wed, 26 Jun 2024 09:30:25 -0400 Message-ID: References: <86ed8tozub.fsf@gnu.org> <86jzijmo5a.fsf@gnu.org> <87h6dmbyy2.fsf@localhost> <87wmmhgjao.fsf@localhost> <861q4k9bjh.fsf@gnu.org> 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="33977"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: yantar92@posteo.net, mitchellahren@gmail.com, 71644@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 15:31:18 2024 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 1sMSk1-0008fJ-Ia for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 15:31:17 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMSjq-0000lR-68; Wed, 26 Jun 2024 09:31: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 1sMSjk-0000i6-6C for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:31:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sMSjj-0003QK-Sm for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:30:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMSjl-0000Md-Sd for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 09:31:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 26 Jun 2024 13:31:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 71644 X-GNU-PR-Package: emacs Original-Received: via spool by 71644-submit@debbugs.gnu.org id=B71644.17194086381344 (code B ref 71644); Wed, 26 Jun 2024 13:31:01 +0000 Original-Received: (at 71644) by debbugs.gnu.org; 26 Jun 2024 13:30:38 +0000 Original-Received: from localhost ([127.0.0.1]:38812 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMSjN-0000LX-Uk for submit@debbugs.gnu.org; Wed, 26 Jun 2024 09:30:38 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:16531) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMSjM-0000L8-F1 for 71644@debbugs.gnu.org; Wed, 26 Jun 2024 09:30:36 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 76589441754; Wed, 26 Jun 2024 09:30:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719408626; bh=4FAkVjSxhbukgFWKSw6JX8VN7l67fwdgcna8OGgEDp0=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=SsxTcke7xaYIklB9E4qymh5Zb1+RXkuxvuxOh7s0bjgaPbo09XwkgvqkvcZaI302x uvgQZqVrDxYorwy7yml7Un3gP0stj8LgHehnqQ4WRhtBmbz5a8umivavq2ZLzYZ0Hm VB6Ls1xFzTrF1vCMZeQNanbF3VH/viR48GjuanAXOXhr0xJh+pZPOo0W1AsBEbdf90 Yq9kdDRoGKP/L5uGQlHuzBbytrGvo9fSfx9qvyytsU/PvSUoANki5Tn8OSB0K1ORT7 dUjagaKzsKaDMUjq6lP5Wy5Rh1Y0esSCQttinRp7s1AbP6gb/+hA1EtKngmXdCfXAj ctFvX78s+h1Yg== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id BCDA0440EE8; Wed, 26 Jun 2024 09:30:26 -0400 (EDT) Original-Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 8953C1207CF; Wed, 26 Jun 2024 09:30:26 -0400 (EDT) In-Reply-To: <861q4k9bjh.fsf@gnu.org> (Eli Zaretskii's message of "Wed, 26 Jun 2024 14:41:06 +0300") 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:287943 Archived-At: >> - The markers histogram is weirdly flat. >> - The markers histogram seems to have a threshold around 800 >> I can't explain. It seems directly related to the buffer size, tho: >> with a file half the size, I get half as many markers (40k) and >> a threshold in the histogram around 400. >> - The number of times we consider exactly 1 marker is probably "too >> high" because the C code happens to look at the first marker before >> checking if it's necessary. > > The fact that it's related to buffer size is probably because your > test buffer is basically N >> 1 repetitions of the same pattern, so > whatever Org does it does that N times, where N is directly > proportional to the buffer size. Yes, definitely. The threshold is at about N/100 where N is the number of markers/headings. But why 100? > How many markers are there in this buffer during the experiment where > you produced the histogram you've posted? My guess is 48400 or > thereabouts? It's the first number in the list (the one before `:markers`): 80044 > Also, what were the buffer positions where you tried your editing > operations? In particular, where those positions distributed evenly > over the buffer? I focused on edits on the first copy and on the last copy. > And questions to Ihor: what are the reasons Org creates these markers? > In particular, is there any way to know or guess whether these markers > will be distributed more-or-less evenly over the buffer text, or > clustered near some specific positions? Also, does Org move these > markers frequently, or do they stay put once created? They're created by `consult-outline` rather than by Org. There's one marker per heading, AFAICT, and so they're very evenly spread (and presumably ordered last-to-first in the `markers` list). Stefan