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 10:08:37 -0400 Message-ID: References: <86ed8tozub.fsf@gnu.org> <86jzijmo5a.fsf@gnu.org> <87h6dmbyy2.fsf@localhost> <87wmmhgjao.fsf@localhost> <861q4k9bjh.fsf@gnu.org> <87r0cjddbe.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="18007"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: Eli Zaretskii , mitchellahren@gmail.com, 71644@debbugs.gnu.org To: Ihor Radchenko Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Jun 26 16:09:11 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 1sMTKh-0004Q2-Kz for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 26 Jun 2024 16:09:11 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sMTKY-00042j-Ps; Wed, 26 Jun 2024 10:09:02 -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 1sMTKW-00042C-0e for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 10:09: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 1sMTKV-0004EI-LG for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 10:08:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1sMTKX-0004Qz-UE for bug-gnu-emacs@gnu.org; Wed, 26 Jun 2024 10:09: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 14:09: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.171941093017028 (code B ref 71644); Wed, 26 Jun 2024 14:09:01 +0000 Original-Received: (at 71644) by debbugs.gnu.org; 26 Jun 2024 14:08:50 +0000 Original-Received: from localhost ([127.0.0.1]:40034 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMTKM-0004Qa-9Y for submit@debbugs.gnu.org; Wed, 26 Jun 2024 10:08:50 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:13210) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1sMTKK-0004QN-UO for 71644@debbugs.gnu.org; Wed, 26 Jun 2024 10:08:49 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 899284417CE; Wed, 26 Jun 2024 10:08:40 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1719410918; bh=v36WrdYoMON+3uXY5K/dSigf/MM9YhmK+0/mx7Qxuc8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=FSdO3V52TQaBVFy6QMqKQjpY46aXMRkv+FmCaJg8E/M0w4gw1VIXITk5RLONRaIrV ZsEQBrDxO4GWh4FeBC0ctnrZBsB1OmsdqU8Wnm5NsNn2T9A4DsbocYUz9rfd1j13ex zyd/DJpo5C6OfUDwDuI41BqMgsB3O1Fo8nDPptu40UWYmQ3WSyjrItunpamFWoLWSx rzeOP6sMyx5BgbElj62IG94+T8OHmG3+9f5g0L5dVw17vEhUIpA6daV4odIkBMxKG1 iTfd8/32VYkMrNKmN4eQBU0HK4re54r8rPkBjpUG4lH/AyrDnUVGLvDVNgigklluvd /lWWHPFhhhD3Q== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id DF2604417E3; Wed, 26 Jun 2024 10:08:38 -0400 (EDT) Original-Received: from pastel (unknown [24.140.236.196]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id ACDA012031C; Wed, 26 Jun 2024 10:08:38 -0400 (EDT) In-Reply-To: <87r0cjddbe.fsf@localhost> (Ihor Radchenko's message of "Wed, 26 Jun 2024 13:49:09 +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:287949 Archived-At: >> Yes, definitely. The threshold is at about N/100 where N is the number >> of markers/headings. But why 100? > > Maybe because > > bytepos - best_below_byte > 5000 > and distance += BYTECHAR_DISTANCE_INCREMENT; > (BYTECHAR_DISTANCE_INCREMENT = 50) > > Then, (/ 5000 50) ; -> 100. > > In other words, > for (tail = BUF_MARKERS (b); tail; tail = tail->next) > loop is roughly bound to (min number-of-markers 100)-ish > repetitions. So, once the number of markers exceeds 100, there is no > more scaling with the marker number. I'm sorry, I don't understand what you're trying to say: The histogram is showing the number of iterations of this loop, and the threshold is not at 100 but at 800 (a.k.a number of markers / 100). Stefan