From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id oBbcK6NiFmIHeQEAgWs5BA (envelope-from ) for ; Wed, 23 Feb 2022 17:36:51 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uO52KKNiFmLuBQEAauVa8A (envelope-from ) for ; Wed, 23 Feb 2022 17:36:51 +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 5A816317D0 for ; Wed, 23 Feb 2022 17:36:51 +0100 (CET) Received: from localhost ([::1]:50892 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nMudG-0000fF-7V for larch@yhetil.org; Wed, 23 Feb 2022 11:36:50 -0500 Received: from eggs.gnu.org ([209.51.188.92]:54280) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nMucW-0000eY-Fh for emacs-orgmode@gnu.org; Wed, 23 Feb 2022 11:36:04 -0500 Received: from [2a00:1450:4864:20::132] (port=39445 helo=mail-lf1-x132.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1nMucU-0000qV-Tr for emacs-orgmode@gnu.org; Wed, 23 Feb 2022 11:36:04 -0500 Received: by mail-lf1-x132.google.com with SMTP id j7so32151188lfu.6 for ; Wed, 23 Feb 2022 08:36:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=SnTgT2CwyzYqZzz6N0dkQicICXQNAFrtc+tw+7A/Vrw=; b=UkdzzP2BdQCksLlMUJSr9U48N4Fwy2t/4BfLkie3Z/hh12olVUE2ZyIGUtvMBQtQk/ whLqvD2EVTbF73qfohI8U8avlxihgDEA9wnCYdvsFAq7qUHpnhhQWlANnHQGtzy3GvAf pKvXnkuSX+2y/yL50iFjMZSokw+utZWnoG/5c03B3C5yeR/UyMm048jGmoTduVGJZzN7 Qy/wLBy5pQLxIXH3vTN17H4H2e9WnPl1YoSbZeJG3ZwoHX2UhKDnT11+pWHmJNbky+tW q6b6Za6G8Gbzom3kclEAVSS7l6tU/aDrma44Hkry1vSxmBuHdzlxKSn8nFhDCQn6kUR+ oGJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references:date :message-id:mime-version; bh=SnTgT2CwyzYqZzz6N0dkQicICXQNAFrtc+tw+7A/Vrw=; b=kuhC6Z/pWJt9PLpcmQrHYdSFos8KLLyZqWMI7V7o4ruaFjjYcLK1Q3iQ6K1FVHNcS0 90nfnfOjIGjciBeyZAJeibkM0m3LSPFcT0r9FGrNZJo8e9WDJdQh+zBkVyqGgH4mfF+F agdvlwgwD1Bb5RQ21l7gAuBdXKUBP1eDY7XgGd+PAHIB64MWTdDNU9JKoW9t5F2sRYIY x7hhvcRN2fg0cRUwml9cFEMiKlbI4KJj7hl9LGF9WojTzwFnaD5bfy9kYXazw5tmsL8S N6as4AoRmftJrgUM9a0ddxnegp1JBPzvSt23ONBTraTlcqXGBlyi3qO4dANaHf8P17lP YiDg== X-Gm-Message-State: AOAM533lRHjDIDxo3blL49MwS7Lunw9vMTKszmVTE1qLqolA93H4UwYX y9Ty3+nHD/mqCULQJ6vivFw= X-Google-Smtp-Source: ABdhPJwn4BhjuQVodxAz7MK7iOUQcNP1jK+rcrA6i8DD86UVd9Th3851CXYOoXQHu2xXFN9zPoyMnA== X-Received: by 2002:ac2:4c51:0:b0:443:95c4:6bd7 with SMTP id o17-20020ac24c51000000b0044395c46bd7mr326934lfk.123.1645634160891; Wed, 23 Feb 2022 08:36:00 -0800 (PST) Received: from localhost ([141.105.67.194]) by smtp.gmail.com with ESMTPSA id q30sm10628ljc.134.2022.02.23.08.35.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Feb 2022 08:36:00 -0800 (PST) From: Ihor Radchenko To: Max Nikulin Subject: Re: profiling latency in large org-mode buffers (under both main & org-fold feature) In-Reply-To: References: <87fsobpism.fsf@localhost> Date: Thu, 24 Feb 2022 00:35:32 +0800 Message-ID: <87r17to817.fsf@localhost> MIME-Version: 1.0 Content-Type: text/plain X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::132 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::132; envelope-from=yantar92@gmail.com; helo=mail-lf1-x132.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.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, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, PDS_HP_HELO_NORDNS=0.659, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, 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: , Cc: emacs-orgmode@gnu.org 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=1645634211; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=SnTgT2CwyzYqZzz6N0dkQicICXQNAFrtc+tw+7A/Vrw=; b=rWfd+L4vQdOKTyTAPrjCNSeZ+ubLiVYha62sH7J5NRhu/fJFNnHyvBmTuwNyUGxwbM8KBA FUSEVR1JyhUpiV3vE0Eoeg/aQPUfDamEmNH9D17Z8rgBVZpimUMfXwae1hNvo4m+TgBTEi Z8np47hoq247jChbj4BPKwtZhnC34ef9889Au4oIPfHxwnB7RVEQJhqGk7dnp1GWPnGmPc 2yECcDUrS6/kDcE8NiT4epfKLp0tr5BDt0sgYAZRB04q99Mr5E4U3rZJQBcAAJHFnP4CRc wxrFppk4q1yAk2OiVUxwJJJP87+DHDsx8wYIemEkvV+ytS5Q4a4emPaACUjnLQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1645634211; a=rsa-sha256; cv=none; b=mt8DVHo4ky2OGNiVvvFm7joZjA5E5ctXD0EIXYJXL4MeHXZzvQjvQhtPrJuajXB8UFBnh2 Cmi/ZdNkMBtDr/DUPOiPQnQT6PxeGYC2Mlx83APaie/EOePsALMVqhSMRJRHZjJ3nsJ3YT xxvjLeaovnhssvJJ2TEubWV9l2klwdSWZLyDS4bjbzb+IVWaxGz2GbRikg0fghDOqfCPzw GSliIu1NYvMxKY2TAdzSdEobsJKcVBCeAik0oM3YvxrpUmxZKSYASZlpz3bZRUaybuWH2o paj7L3wAP7PHe1d5TFUvqibs62uL/EN3ISh8Wp51oHbkLSbGlaFWAfE+oOSl/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UkdzzP2B; dmarc=pass (policy=none) header.from=gmail.com; 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: -8.93 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=UkdzzP2B; dmarc=pass (policy=none) header.from=gmail.com; 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: 5A816317D0 X-Spam-Score: -8.93 X-Migadu-Scanner: scn0.migadu.com X-TUID: RpbYrSC9V7ID 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. FYI, a more optimal overlay data structure implementation has been attempted in feature/noverlay branch (for example, see https://git.savannah.gnu.org/cgit/emacs.git/commit/?h=feature/noverlay&id=8d7bdfa3fca076b34aaf86548d3243bee11872ad). But there is no activity on that branch for years. Best, Ihor