From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gLWaJWbSGGJJDwAAgWs5BA (envelope-from ) for ; Fri, 25 Feb 2022 13:58:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id 6JdXHmbSGGKUXQEAG6o9tA (envelope-from ) for ; Fri, 25 Feb 2022 13:58:14 +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 18E7D2A6BB for ; Fri, 25 Feb 2022 13:58:14 +0100 (CET) Received: from localhost ([::1]:56412 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nNaAn-0003Rn-9h for larch@yhetil.org; Fri, 25 Feb 2022 07:58:13 -0500 Received: from eggs.gnu.org ([209.51.188.92]:56320) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNZrc-0004wW-AW for emacs-orgmode@gnu.org; Fri, 25 Feb 2022 07:38:25 -0500 Received: from ciao.gmane.io ([116.202.254.214]:60246) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nNZrZ-00024B-NN for emacs-orgmode@gnu.org; Fri, 25 Feb 2022 07:38:23 -0500 Received: from list by ciao.gmane.io with local (Exim 4.92) (envelope-from ) id 1nNZrV-00078q-Na for emacs-orgmode@gnu.org; Fri, 25 Feb 2022 13:38:17 +0100 X-Injected-Via-Gmane: http://gmane.org/ To: emacs-orgmode@gnu.org From: Max Nikulin Subject: Re: profiling latency in large org-mode buffers (under both main & org-fold feature) Date: Fri, 25 Feb 2022 19:38:09 +0700 Message-ID: References: <87fsobpism.fsf@localhost> <87r17to817.fsf@localhost> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.5.0 Content-Language: en-US In-Reply-To: <87r17to817.fsf@localhost> Received-SPF: pass client-ip=116.202.254.214; envelope-from=geo-emacs-orgmode@m.gmane-mx.org; helo=ciao.gmane.io X-Spam_score_int: 28 X-Spam_score: 2.8 X-Spam_bar: ++ X-Spam_report: (2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_ADSP_CUSTOM_MED=0.001, FORGED_GMAIL_RCVD=1, FORGED_MUA_MOZILLA=2.309, FREEMAIL_FORGED_FROMDOMAIN=0.249, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.249, NICE_REPLY_A=-0.001, NML_ADSP_CUSTOM_MED=0.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=no 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" X-Migadu-Flow: FLOW_IN X-Migadu-Country: US ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1645793894; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to: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; bh=sqXrINzU9Bk2qeZ+JV1v1atPrq22TWZPl5JVXHfvIAQ=; b=Z83bVbL5axAQyJytfoAo3ajvEQm9NFhH4mmJ4wXNFK8PlS4mjoq3hQ37Fdol1pX8rCRmKo tEZ0vYBbE/byZv3rL1l1ttZteC9Vp5jeTE4nw6827uIHRI4Wwzi+gxxcizb2HCrwpl03Wr NatndzOOKvZpEcINMpVkzppDEhaCzzajv2HaXl417jr3pBXe4ChSUsyGzCcy7j6pWfmVpK qrmyEo1cbDZtmu0HdfD5C3RhkjxOdFh/nsKrrbwv5ZEvrdQAB7r5JsRVbn77fOxl5cYtuD Pt/JJUTmbtPaEWjGHEp/q5lqoQwIQAleO+uNSbS4Oto8jci0j40Eh/6rPQmbPA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645793894; a=rsa-sha256; cv=none; b=nEpOljYVOxbpT7ymkG30Bqd6so7eKoDRFolSQF51iTZjKDFUMUiEliac6Xhi6WyyNUWevj i4s/YuxhNXAdKfFYEJrZOCPTrsRS7JT7jut750SbNICz7xKyNKqoa9GE+HMmpCzTdiOjlG pd+aLQVSSFjZQVVDAcuinUbq1/9+G3V11SPplg09wmZWOvXTjZVuc4bDs0B60gUg9ro+y6 18YVbPLOpmugNaI+thoY5vs6CF4rKeu3Csg1JDcN8pCeozQidA9eQCsAdUKFs0wifDsv69 oKNiOuQiczySOAZTEvutycH7IhXEd8pUABwSyLUfmQfebi7oR0AJwwhrhnoV7Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" X-Migadu-Spam-Score: 2.07 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=fail reason="SPF not aligned (relaxed), No valid DKIM" header.from=gmail.com (policy=none); 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" X-Migadu-Queue-Id: 18E7D2A6BB X-Spam-Score: 2.07 X-Migadu-Scanner: scn0.migadu.com X-TUID: tRg+Z1vf94Jl On 23/02/2022 23:35, Ihor Radchenko wrote: > Max Nikulin writes: > >>> +;; the same purpose. Overlays are implemented with O(n) complexity in >>> +;; Emacs (as for 2021-03-11). It means that any attempt to move >>> +;; through hidden text in a file with many invisible overlays will >>> +;; require time scaling with the number of folded regions (the problem >>> +;; Overlays note of the manual warns about). For curious, historical >>> +;; reasons why overlays are not efficient can be found in >>> +;; https://www.jwz.org/doc/lemacs.html. >> >> The linked document consists of a lot of messages. Could you, please, >> provide more specific location within the rather long page? > > There is no specific location. That thread is an old drama unfolded when > intervals were first implemented by a third-party company (they were called > intervals that time). AFAIU, the fact that intervals are stored in a > list and suffer from O(N) complexity originates from that time. Just > history, as I pointed in the comment. Thank you, Ihor. I am still not motivated enough to read whole page but searching for "interval" (earlier I tried "overlay") resulted in the following message: Message-ID: <9206230917.AA16758@mole.gnu.ai.mit.edu> Date: Tue, 23 Jun 92 05:17:33 -0400 From: rms@gnu.ai.mit.edu (Richard Stallman) describing tree balancing problem in GNU Emacs and linear search in lucid. Unfortunately there is no "id" or "name" anchors in the file suitable to specify precise location. Even the link href is broken. Actually I suspect that markers may have a similar problem during regexp searches. I am curious if it is possible to invoke a kind of "vacuum" (in SQL parlance). Folding all headings and resetting refile cache does not restore performance to the initial state at session startup. Maybe it is effect of incremental searches. Sorry, I have not tried patches for text properties instead of overlays.