From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id IOy7FM92E1+ACAAA0tVLHw (envelope-from ) for ; Sat, 18 Jul 2020 22:25:19 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id aLtxEM92E19oeQAAbx9fmQ (envelope-from ) for ; Sat, 18 Jul 2020 22:25:19 +0000 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 CB05B9403A2 for ; Sat, 18 Jul 2020 22:25:18 +0000 (UTC) Received: from localhost ([::1]:38646 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jwvGf-0007jY-On for larch@yhetil.org; Sat, 18 Jul 2020 18:25:17 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:50290) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwvGG-0007jM-HD for emacs-orgmode@gnu.org; Sat, 18 Jul 2020 18:24:52 -0400 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:58703) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jwvGE-0005Lh-Mn for emacs-orgmode@gnu.org; Sat, 18 Jul 2020 18:24:52 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 1E73C5C008F; Sat, 18 Jul 2020 18:24:50 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sat, 18 Jul 2020 18:24:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imapmail.org; h= from:to:subject:in-reply-to:references:date:message-id :mime-version:content-type; s=fm3; bh=3ItPdGZwA0hDyiOsLn+vlKUrwa qOcgQ7e9QtoubELN4=; b=C4xPBng8xTGHxOdj5N+Otmi5Kq/yR0rrU8DEzyx//J aL9TBflnjvUt4SS96Ml0RS+NPyk0mR/DOsoIsAb6pfaiNQ40m+qRXrIjcWpoTV0G hB9lUeQ6ZpMA/iGIrtRafmDvYso27vQUPvHmY/RXGIT3p7XqwK5TwrBeRSsjp2sQ e8vGR1eOz06mUfYAsoliN4wzS0r+3FHLK+SosEqin7gH0ITsihdCJvr4eFsYQlwI kNawy3aHfNv2kBT8D81CBviTNkPNahEOA354pWJS9mBdXiZDLL/zGMoy35f9AWLs CxGgPmmsgPCkPDrfZZ72YR869at1ORxmQ3X8i7Ko9ssA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=3ItPdG ZwA0hDyiOsLn+vlKUrwaqOcgQ7e9QtoubELN4=; b=ohGMNuh3BS8/6TXXnV00Bt 3DNPtUKsn1wMiodbj1A7Q+VLV3srHNc6AGD2OSbeju+wDVU2tVqtvAM70fQzDsof oLDHqVTqTS5Gclp8+Zn59rZtr5ZlJI4TXQlKfWb8TmICkCTcihprgmgkV3Bqd/bu ZWrB8OAYPdadTbZrpU9RVGfjfXSfH4CNISll0+/CTnfL/qlPvHTw8A0AVQayVkGI AzGhP6GkO0xevqvANS1wAAFbokMeX9j6JeyIMbvRALrP/yrcCZD7TSJqmRLhC2oN qQ3Jlc3bhUuvHoRQ2eewvmzRALpSecv8iOW8NbD4uX+ZJilXRH7nSk3GDlhEQrwg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduiedrgedtgdduudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffujghffffkgggtsehttdertddttddtnecuhfhrohhmpeforghtthcunfhu nhguihhnuceomhgulhesihhmrghpmhgrihhlrdhorhhgqeenucggtffrrghtthgvrhhnpe elteduffelgeetfeehheehkeeikefhuedvhfeuudefffeljeekueethfekffejkeenucfk phepjeeirdduiedrudefhedrudduleenucevlhhushhtvghrufhiiigvpedtnecurfgrrh grmhepmhgrihhlfhhrohhmpehmughlsehimhgrphhmrghilhdrohhrgh X-ME-Proxy: Received: from localhost (c-76-16-135-119.hsd1.il.comcast.net [76.16.135.119]) by mail.messagingengine.com (Postfix) with ESMTPA id B255D328005D for ; Sat, 18 Jul 2020 18:24:49 -0400 (EDT) From: Matt Lundin To: Org Mode List Subject: Re: [BUG] incorrect (and slow) indentation of logbook entries In-Reply-To: <87r1t8sdhd.fsf@fastmail.fm> References: <87r1t8sdhd.fsf@fastmail.fm> Date: Sat, 18 Jul 2020 17:24:48 -0500 Message-ID: <87blkcsbpr.fsf@fastmail.fm> MIME-Version: 1.0 Content-Type: text/plain Received-SPF: pass client-ip=66.111.4.25; envelope-from=mdl@imapmail.org; helo=out1-smtp.messagingengine.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/07/18 17:46:39 X-ACL-Warn: Detected OS = Linux 2.2.x-3.x [generic] [fuzzy] X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 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-Scanner: scn0 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=imapmail.org header.s=fm3 header.b=C4xPBng8; dkim=pass header.d=messagingengine.com header.s=fm3 header.b=ohGMNuh3; dmarc=pass (policy=none) header.from=imapmail.org; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Spam-Score: -1.71 X-TUID: kDbdsvrnN6Hj Matt Lundin writes: > Commit e3b79ad2bf7ab7b91c0ad2b8383d639bfe154ce7 from Feb. 9, 2020 (Allow > a new value for `org-adapt-indentation') introduced a bug that causes > logbooks to be incorrectly indented when promoting an entry. As a > result, there are also significant slowdowns when promoting and demoting > an entry with hundreds of logbook entries. I did some more investigation and think the bug may lie deeper. The commit above changed the functions used in org-fixup-indentation. Prior to the commit org-fixup-indentation called org-indent-line on each line within a LOGBOOK. Now it calls org-indent-region on the entire LOGBOOK. So the problems seem to lie in org-indent-region. To test this, I manually called org-indent-region on a region containing a LOGBOOK. I saw the same indentation problems and slowness as I reported in the previous email. Here are the profiling results from calling org-indent-region on a LOGBOOK containing 303 lines (mix of notes, clock drawers, state changes): org-indent-region 303 20.374798015 0.0672435578 org-element-at-point 655 6.7059473859 0.0102380876 org-element--parse-to 654 6.6907969839 0.0102305764 org-element--current-element 36791 6.3040008640 0.0001713462 org-element--list-struct 3372 3.6317395729 0.0010770283 org--get-expected-indentation 355 3.00431385 0.0084628559 org-element-clock-parser 2738 0.7868292469 0.0002873737 org-element-item-parser 29700 0.7527248339 2.534...e-05 org-element-timestamp-parser 2738 0.7245477349 0.0002646266 org-parse-time-string 5476 0.6267072680 0.0001144461 org-element--collect-affiliated-keywords 4026 0.2572965799 6.390...e-05 org-element-drawer-parser 654 0.1057650070 0.0001617201 org-element-plain-list-parser 3372 0.0736009140 2.182...e-05 org-get-limited-outline-regexp 9063 0.0575772250 6.352...e-06 org-at-heading-p 8083 0.0267149439 3.305...e-06 org-element--cache-put 36791 0.0176797030 4.805...e-07 org-element-paragraph-parser 327 0.011128276 3.403...e-05