From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp10.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms5.migadu.com with LMTPS id GMzLCftglmNJgQAAbAwnHQ (envelope-from ) for ; Mon, 12 Dec 2022 00:00:11 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp10.migadu.com with LMTPS id yC4eCftglmNZTQEAG6o9tA (envelope-from ) for ; Mon, 12 Dec 2022 00:00:11 +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 BDFDCBBB3 for ; Mon, 12 Dec 2022 00:00:10 +0100 (CET) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p4VI9-0001vT-6S; Sun, 11 Dec 2022 17:59:29 -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 1p4VI8-0001vE-Eg for emacs-orgmode@gnu.org; Sun, 11 Dec 2022 17:59:28 -0500 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p4VI6-0003eO-I3 for emacs-orgmode@gnu.org; Sun, 11 Dec 2022 17:59:28 -0500 Received: by mail-pj1-x102e.google.com with SMTP id u15-20020a17090a3fcf00b002191825cf02so10325356pjm.2 for ; Sun, 11 Dec 2022 14:59:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=SArtIpxH5+NhB0XOmYqr7V1k1JTn7DGvAUJffJZ/xlQ=; b=Re6mEDDEMGXmvE/RtVmB42mKlgKl7wBA05nxiCu0GDftyaw6Iiokfg/Hx9REF6VjdV jkpxkVZ/ICVlFPg2koubaHq4AX/9j4FRBkoXCJrA861DlrQ7Zl5f/6U3Kuj+NoJ8O29m j3AYmZt+bK+CfHHv/+Ecl1IpQCAc9HtcNLxucyW8/Gd3ymmmircGzERxYFhFyY56gz0L Tu42VyoXoBf/Oq+6xFxjCCSYizmUTNSpP0znCpl1+7tDjo40Wy9nEtz4nkdQ62vMKAyK g5/vyQIEf1sc+jT+P1D8QXhqajbC95nZY9s6puStzfkD1YsmZCGkETzsq+M+uRG+Oqug prcg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=SArtIpxH5+NhB0XOmYqr7V1k1JTn7DGvAUJffJZ/xlQ=; b=xKyxwjRGg36Rxfl0oQPq61/s5kv5k0CVEnC5uKQ7PI/vbQydUqCyj5z4+0IrSyX5FP PRoKTTxsb789wSlFtsCP7UzEzZ8wDquqsttUTM4ZOu+Xevf4Yqtr/xx/ude1b7ug7TEP 1DmGpIi6wv/9ebonFrsUA3yoa3tu5SX401X8Tg6BjBISwrcf7LIFpPjYK+6azJ5Hxg5C Fl6MC3rs4YgFf4J853Z4KYOxTRVdxyiMzU68JuIkoukHKMDpj74+BFvgvkm/UQ0FTKzX G7emaacuvisdn2nZpi9Et3E41QMBA8dMqvXySjePR2vJfVIKatrLDcJpHJ42Y6LFzP3f yV1g== X-Gm-Message-State: ANoB5pnAor3HKYBi2vx55cvrpNYk09BP97jrzXQriHRPDFVM6FhVLThj qc787YVEUjpNpGFhOL1ovAYtLxgn2sg8X3cnqhE= X-Google-Smtp-Source: AA0mqf5dyTOsO2P91DZ1hBN/wUS4EXJUGaMLBOm07Ms+NnheMIakSdCiyFLVT3pcWBzn0IRNOz3z/u109iKW0cL7Iwc= X-Received: by 2002:a17:902:f812:b0:189:9a71:109b with SMTP id ix18-20020a170902f81200b001899a71109bmr45790208plb.171.1670799563519; Sun, 11 Dec 2022 14:59:23 -0800 (PST) MIME-Version: 1.0 References: <87y1rjjqk0.fsf@localhost> <87k02zr1xm.fsf@localhost> In-Reply-To: <87k02zr1xm.fsf@localhost> From: arozbiz@gmail.com Date: Sun, 11 Dec 2022 16:58:48 -0600 Message-ID: Subject: Re: Flyspell causes severe slowdown when manipulating footnotes To: Ihor Radchenko Cc: emacs-orgmode@gnu.org Content-Type: multipart/alternative; boundary="000000000000797c7105ef955694" Received-SPF: pass client-ip=2607:f8b0:4864:20::102e; envelope-from=arozenshtein@gmail.com; helo=mail-pj1-x102e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 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-Country: US X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1670799610; 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=SArtIpxH5+NhB0XOmYqr7V1k1JTn7DGvAUJffJZ/xlQ=; b=EvWOWpwKogKVexfwn6aGIMWst+qDeRS+LG/SftykMnjq2bWgaqY0I1pZ1jm+edynsVZaQU 5vCJMjqcSMyrHWAI/SYf9Xo14GwBtsykeZc/UjjSH/6HCgV/3LPSY8+7v3RiJU/mNedqTn 30dtx+fzWb2TNOM82GE56qcFyLw31sEHifcSSaG5r75OkqHWyXCWFHtoxCI2CZAfX0yHFE iRGxQbpKma0rU5cnUOElEY0J8FakndZ8d5m/oAG9Z0ZWTanLkObCt0GYn3pQHhtVicP/Th 8Rox1N9b6+LJqMBW26EN+onLDL16e3T6DPezUTWrUlJGZs5xwWwvwAqsCnzy2Q== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Re6mEDDE; 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"; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=key1; d=yhetil.org; t=1670799610; a=rsa-sha256; cv=none; b=c/9MqW7tXo5OyN2sgnwBrEaMtZ0eMLS1gxB4sswijYtJgNYiXYE5LsWZV6qZ2ckvDlTP6+ noBs9ysS31FhRwPP5nfibt3dz2PXOzJVdfcBTkSlJHC8zV+ZrJvd+Wkc2ZbRCXLA968DAl GAAmBHoDuGUtv/SNsizl4oFX7FIC/CuoMrmsiDzrYDtis3M1SNMMe8ttbSzpnBDRWlO9fj hyLeRXU3j5RIHEp8ElmdivebwTeP948eg4hFcGVm1z28pNTQmnulmDeDPNKTzSFQ5fsyVg zWcoAEss2OJQ/RvPq/4jJxSLWt3fMwKUW1iJ7ASoZObTc+ly9w29cXQ086/pPQ== X-Migadu-Spam-Score: -9.40 X-Spam-Score: -9.40 X-Migadu-Queue-Id: BDFDCBBB3 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Re6mEDDE; 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"; dmarc=pass (policy=none) header.from=gmail.com X-TUID: raGdRFtZlV0x --000000000000797c7105ef955694 Content-Type: text/plain; charset="UTF-8" Thanks. It definitely helps, but it's still quite slow. What's made the biggest difference is is advising the relevant functions to turn flyspell off beforehand and then turn it back on. ``` (defun azr/org-footnote-disable-flyspell (orig-fun &rest args) (flyspell-mode -1) (apply orig-fun args) (flyspell-mode)) (advice-add 'org-footnote-new :around #'azr/org-footnote-disable-flyspell) (advice-add 'org-footnote-delete :around #'azr/org-footnote-disable-flyspell) ``` Best, Alan On Sat, Dec 10, 2022 at 4:24 AM Ihor Radchenko wrote: > arozbiz@gmail.com writes: > > > Thanks Ihor for the response. Unfortunately, setting > > org-element--cache-self-verify to nil didn't work. Profile report > attached. > > Thanks! > I just pushed a slight optimization to the footnote sorting code. > Can you try again using the latest main? > > https://git.savannah.gnu.org/cgit/emacs/org-mode.git/commit/?id=169333e1c > > -- > Ihor Radchenko // yantar92, > Org mode contributor, > Learn more about Org mode at . > Support Org development at , > or support my work at > --000000000000797c7105ef955694 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Thanks. It definitely helps, but it's still quite slow= . What's made the biggest difference is=C2=A0is advising the relevant f= unctions to turn flyspell off beforehand and then turn it back on.

=
```
(defun azr/org-footnote-disable-flyspell (orig-fun= &rest args)
=C2=A0 (flyspell-mode -1)
=C2=A0 (apply orig-fun arg= s)
=C2=A0 (flyspell-mode))

(advice-add 'org-footnote-new :aro= und #'azr/org-footnote-disable-flyspell)
(advice-add 'org-footno= te-delete :around #'azr/org-footnote-disable-flyspell)
``= `

Best,
Alan

On Sat, Dec 10, 2022 at 4:24 = AM Ihor Radchenko <yantar92@poste= o.net> wrote:
arozbiz@gmail.c= om writes:

> Thanks Ihor for the response. Unfortunately, setting
> org-element--cache-self-verify to nil didn't work. Profile report = attached.

Thanks!
I just pushed a slight optimization to the footnote sorting code.
Can you try again using the latest main?

https://git.savannah.gnu= .org/cgit/emacs/org-mode.git/commit/?id=3D169333e1c

--
Ihor Radchenko // yantar92,
Org mode contributor,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,=
or support my work at <https://liberapay.com/yantar92>
--000000000000797c7105ef955694--