From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms8.migadu.com with LMTPS id uFULCjVOT2XuTwAAG6o9tA:P1 (envelope-from ) for ; Sat, 11 Nov 2023 10:49:41 +0100 Received: from aspmx1.migadu.com ([2001:41d0:303:e224::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id uFULCjVOT2XuTwAAG6o9tA (envelope-from ) for ; Sat, 11 Nov 2023 10:49:41 +0100 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id F0745163D2 for ; Sat, 11 Nov 2023 10:49:40 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jL3eAAME; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Seal: i=1; s=key1; d=yhetil.org; t=1699696181; a=rsa-sha256; cv=none; b=uz/w/OpA7iiENJu1zEA6LoD9Nq55TmXr3rl7qM2DiWPCfpC9oDZVo/ZJazC4v7U33WyanC Hg/y3V4XXnEFUDlnqiTKPy+W2nrYLglRPX3p0GFqzEpuJTvxKZxb0yG2HNthKKrw2mAqSc qsYNUe9mzkrgiqwAVc14CHioexrJj3DRfLC2Dm5yhLVerpFDCTIB63HYHlEjOhVDm/+AP2 gJ+whXFJmLj2U+Nv96ed8ooRXRQyHmZOAGubaMRtXp0HoylqEpiGvJf/S1qYSjpHGHPXkO oLjxFgD2Eko/4EoFVTN4+Y4TSbGf0uOldgnVSLnJVYKTBkLmXpJ0rKTXPk3XZA== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=posteo.net header.s=2017 header.b=jL3eAAME; dmarc=pass (policy=none) header.from=posteo.net; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1699696181; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post:dkim-signature; bh=/8LEW05n148x+kotdsWxwThe3AQot8GFNCGymsAHFso=; b=U5PzZb7bpmbQBNZirWmdvp5jpgd/5ndYcsnf5WxPhL8uo4ueYMhQEHhn7HVT6P29WCSTBa 5eP/9ZsjqqNEKkigMyQZT4sIzkB7eTFsIzvyPkPgsHNS4WfJ0PygQVnUsHJ0sb/QBlFcAF vB2bv/IR8xDDwGQpDNELZw3YBB/uH7AsfGwc7v9Tag+AXCYtvb5wHJT/t6P1KUBrscO11D Ky6ByRWOt7+0MMmypjdbtrQCjKNTCGUoztmfyytIDuwTghwZTrldSvixXjzvi1iv6nAyTj RXDc63ckxOQUHjJqU4iMUnjnHtHx1rpANUtlLwE8u2lf0ULDbzlVfkNditSOFg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r1kbg-0004O7-14; Sat, 11 Nov 2023 04:48:48 -0500 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 1r1kbd-0004Nw-K2 for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 04:48:45 -0500 Received: from mout01.posteo.de ([185.67.36.65]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r1kbb-00056k-63 for emacs-orgmode@gnu.org; Sat, 11 Nov 2023 04:48:45 -0500 Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id DBAC1240027 for ; Sat, 11 Nov 2023 10:48:39 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1699696119; bh=/8LEW05n148x+kotdsWxwThe3AQot8GFNCGymsAHFso=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version: Content-Transfer-Encoding:From; b=jL3eAAME0DnWgj2zN9tsBLd+SPi4pYMNbLMJEfZ9SoErnITdFOpgJMMWdl8pAdn5g o+SNLQ7cub2xYBZqh3TKRP8V4toYp90dskAesM4QKLLamNQ9i92n4it6Lo2WuuGs9N C06+GQdE/9mQMtrNVmjEatp1dQpCsK3YVF9r6fpMOosA3KlIckjevkfNLrZFAZbGMP tRVlZb/tltG1NvCBILRZt9+MEO7beDpZjmg4tSCynM41JdR9u+X4fK6hvmmjndLzjt 6kEsk2wH7VyD6/jysll7QgFbvVAw7KTeaA/RCp8cS82P+wkrwNtYxMM7aA+5wVyWMK lSaBg55gOGNMg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4SS9qp3FP1z9rxH; Sat, 11 Nov 2023 10:48:37 +0100 (CET) From: Ihor Radchenko To: Sebastian =?utf-8?Q?W=C3=A5linder?= Cc: emacs-orgmode@gnu.org Subject: Re: Slowdown with large headings in view In-Reply-To: <87il69cpoa.fsf@nixos.mail-host-address-is-not-set> References: <87il69cpoa.fsf@nixos.mail-host-address-is-not-set> Date: Sat, 11 Nov 2023 09:50:48 +0000 Message-ID: <877cmowrd3.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Received-SPF: pass client-ip=185.67.36.65; envelope-from=yantar92@posteo.net; helo=mout01.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: emacs-orgmode-bounces+larch=yhetil.org@gnu.org X-Migadu-Flow: FLOW_IN X-Migadu-Country: US X-Migadu-Queue-Id: F0745163D2 X-Migadu-Scanner: mx12.migadu.com X-Migadu-Spam-Score: -6.36 X-Spam-Score: -6.36 X-TUID: bPrResDyRTVJ Sebastian W=C3=A5linder writes: > I have massive org-mode file with thousands of SRC blocks. > > As the file grew, I started to get very poor performance, but setting `or= g-fold-core--ignore-modifications` to `t` solved it. > > However, I still get very poor performance when a lot of folded headings = are in view. It gets slower as headings with more text hidden inside its fo= ld come into view. > > I have tried running the profiler to find out what the issue is, but no m= atter how laggy Emacs gets, the profiler records practically no CPU samples= or memory usage. > > When the massive org buffer is in view and showing large folded headlines= , any command run is very slow, even if the action is performed in another = buffer entirely. It returns to normal when no window is showing the heading= s, as well as when I bring the folded headings out of view or unfold them. This is expected. The problem is with Emacs redisplay engine that cannot easily handle large number of text properties - on C level. You can try to set `org-fold-core--optimise-for-huge-buffers' to '(grab-invisible) locally in the problematic Org file - it should reduce the number of text properties used at the cost of not preserving folded drawers when folding the containing heading. --=20 Ihor Radchenko // yantar92, Org mode contributor, Learn more about Org mode at . Support Org development at , or support my work at