From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id 8HvzDpKu0WD7MAAAgWs5BA (envelope-from ) for ; Tue, 22 Jun 2021 11:34:10 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id eNB4OZGu0WCrXAAAB5/wlQ (envelope-from ) for ; Tue, 22 Jun 2021 09:34:09 +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 3703D18BDB for ; Tue, 22 Jun 2021 11:34:09 +0200 (CEST) Received: from localhost ([::1]:41182 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lvcnI-0000DG-76 for larch@yhetil.org; Tue, 22 Jun 2021 05:34:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:46720) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvZj9-0002Tr-9d for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 02:17:39 -0400 Received: from esa1.hc253-53.ap.iphmx.com ([139.138.42.212]:56502) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lvZj6-0007ob-Gf for emacs-orgmode@gnu.org; Tue, 22 Jun 2021 02:17:39 -0400 IronPort-SDR: ryEe4RErl8Q8OyO3WlSsfPC7+UbDDQ4MOiMupxg88RztxJit2oj5E2o6RR6wEMIc6+iYfYzr5S 8oo+enJI8J4ZxO0Gl+US2mBVzBczPvnvyq7Xkt7k6LjY0IVkD0YUqQr8KrYFz82RZSDqLmGPAv /edPbtENLtwrW1tobpKaSm+IDvr5hjyTMEzfvLvKPxyshM60DaFb0ZyjIVNwZa6k6vfGfwvnkS ots9PhkLNfL3uAsA5VphrDJcJeqltqVeWoIrFdl/684O/frapkFC3erbQ+iZFY8Lz1UREtcfvj G9c= X-IPAS-Result: =?us-ascii?q?A2GLAACaf9FgjM+AX4JaHAEBAQEBAQcBARIBAQQEAQGCB?= =?us-ascii?q?gQBAQsBgSJTBoEmVmyESHGIE4cnAQEGgUADmHeCaIERAxg8CwEBAQEBAQEBA?= =?us-ascii?q?Qk3CgQBAQMBA4RJAoJvJjcGDgIEAQEBAQMCAwEBAQEBBAEBBgEBAQEBAQUEA?= =?us-ascii?q?QECEAEBAQFshS85DYI4DIESMiEDAQEBAQEBAQEBAgEBASICAQEBAQEBAQEBA?= =?us-ascii?q?QEBAQEBAQEBARYCDQdLB18BAQEBAxIRHQEBNwEPCxEDAQIJASECAg8BFhYTC?= =?us-ascii?q?AYSASKCTwGCVQMJJg+XHgGBKT4CIwFAAQyBCIkMeoEygQGCBwEBBoYMgVkDB?= =?us-ascii?q?oE6AYcGAYVoekN9gRCBS4I+Lz6CIEICAoEkWoJ3gmSDARk4XSoCVElgNZFhj?= =?us-ascii?q?S9NimaSA4Mpgn6HFopWgzmGBoNegnSfIJdwigaDKY9MPIUcgWqBf00fGYMkU?= =?us-ascii?q?BkOjh8ZgQsBAYEEhCqIBzcvAjYCBgEJAQEDCYxrAQE?= IronPort-PHdr: A9a23:2Cjk4RXp/s0cikAcuAzQqKKnEWbV8Kw3VTF92vMcY1JmTK2v8tzYM VDF4r011RmVBNSdsK4cwLKJ+4nbGkU4qa6bt34DdJEeHzQksu4x2zIaPcieFEfgJ+TrZSFpV O5LVVti4m3peRMNQJW2aFLduGC94iAPERvjKwV1Ov71GonPhMiryuy+4ZLebxhMiTanb75/I wm6oQrNusQUnIBvNrs/xhzVr3VSZu9Y33loJVWdnxb94se/4ptu+D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GXofdfU1SL3+qy nKpp4mPHDP6Qr5NEtMpfmhP+2aTWrY5dpp5+AqTNWftWrdyQ+VxeNZnO7fKlTbckWUygce78 ddmsNFZuEYY2IXse/H+gWiV94vzN6bmZrY5tvj8w== X-IronPort-Anti-Spam-Filtered: true Received: from ob03.uwa.edu.au (HELO mailfish.ucc.gu.uwa.edu.au) ([130.95.128.207]) by esa1.hc253-53.ap.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Jun 2021 14:17:19 +0800 Received: from smtp by mailfish (authenticated submission) with ESMTPSA id 5FB9F2A0212; Tue, 22 Jun 2021 14:17:18 +0800 (AWST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=ucc.asn.au; s=ucc-2016-3; t=1624342638; bh=dJyZzp0oLlHX8PBGDTs6HYGmwvpnr7oURPBEbub0qbc=; h=From:To:Cc:Subject:Date:References:In-reply-to:From; b=gT1msSpQn1ifDHiUGyk5EZtV/uTfEz5B4Cwq/9Z/Ex9dkxv3TkzBR5FcQDwMukdNp bk8ISjVhOmLiRKS2DN+Ss9LlTO5TDk/YX1Wj2gP11pwvppLrkyKWNlKeuLMyaTcr1r K/rNNGytfOWSahIL5+HBeKNnczu9yG/8qnFANmlg= From: Timothy To: =?utf-8?Q?L=C3=A9o?= Ackermann Subject: Re: Large source block causes org-mode to be unusable Date: Tue, 22 Jun 2021 14:10:37 +0800 References: User-agent: mu4e 1.4.15; emacs 28.0.50 In-reply-to: Message-ID: <87lf725spe.fsf@ucc.asn.au> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Received-SPF: none client-ip=139.138.42.212; envelope-from=tec@ucc.asn.au; helo=esa1.hc253-53.ap.iphmx.com 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, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_PASS=-0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Tue, 22 Jun 2021 05:33:02 -0400 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: , Cc: emacs-orgmode@gnu.org Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624354449; 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=n4CQ0ck9lftWqwjPSuPgXZ8pcgElK8FTfZxliGBezlA=; b=cewYirsOgViylDvE/LO7isFTNI08v8MESiW9Xtvt7ndtlbwLFu10V8hjxA1Z9IMGjYHpTx faDBd3fCseR3rivxvWkowEP9rPfQ/dkq8qpuJvFY9VbJvT75GdTbxnpApjeqIx2yTue2xu zq0KRXEThGrFGNuCnIs+a/G6s+G9zvZdKkH9yh11EM7wDNm9lE+y9TVm7fnHDmAY2j8byt Q5dWSkPL9Z4C/oD4Z3t7Ip5p7VS+eoe4ooEjSvZ3Adi9n18ahK+w2rjtx1ZkuqSLxU/irM yiDZG/obTY1Yp6Gaa9XwINVBxdAFM+23jlbTdugi+qilLGbNBj0QB012hJjOhA== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624354449; a=rsa-sha256; cv=none; b=Yuw4USngvzY9hm14V6yn4QBHnVYo7hkmbKNqAUxWK2c/z89HECktAZYpdoZD2R1iaQjRNL 2zUyHOG1fCoU88z1NY9UEbhQ7DiNiuG7Ww9Y7aBM58+iuPrXM1mqaD/6ciXMNmgiUs4qsO WecC0IxkfLYlkryDHicUoL/Zn8z5hFh/2W6cPdKbb7dOBY9+UpMfPvvG4l3I5WL1KgH+8p EOkyZzrZXP2hQ1IKI7ejzVkNE1US5AqSfi4DiJNaKmM6sW1fn8y7H30rpyceqq7jVIVu/B 7fqDJu7Josx2I99oAxDFC7YffLRvNOS1OoWWBrM+jKrrfMqb1TC+Yrs2zZ8+2g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ucc.asn.au header.s=ucc-2016-3 header.b=gT1msSpQ; 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-Migadu-Spam-Score: -0.43 Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=ucc.asn.au header.s=ucc-2016-3 header.b=gT1msSpQ; dmarc=none; 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-Migadu-Queue-Id: 3703D18BDB X-Spam-Score: -0.43 X-Migadu-Scanner: scn1.migadu.com X-TUID: DNBgBY0qMqbD --=-=-= Content-Type: multipart/alternative; boundary="==-=-=" --==-=-= Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi L=C3=A9o, I think I can actually speak a bit on this. As it stands, babel fontificati= on operates by: - sending the src block to a dedicated buffer - turning on the relevant major mode for the language - forcing font-lock of the entire buffer - cloning the font-lock information for the entire buffer back to Org In essence, every keystroke in a babel block causes font-lock lag equal to opening the file for the first time. As you can imagine, this adds up. I think ideally Org would monitor which block you're executing keystrokes i= n, and if there are a few in a row in the same org-src block keep the font-lock buffer alive and incrementally update the content and intelligently copy ba= ck font-lock changes. This has the potential to be much lower latency, but is = also going to be hard to get right. In the meantime, you could try executing something like this in your Org buffer ([source]): ,---- | (setq-local jit-lock-defer-time 0.05 | jit-lock-stealth-time 1) `---- This sacrifices immediate font-lock accuracy for responsiveness. All the best, *Timothy* [source] --==-=-= Content-Type: text/html; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable

Hi L=C3=A9o,

I think I can actually speak a bit on this. As it stands, babel fontificati= on operates by:

  • sending the src block to a dedicate= d buffer
  • turning on the relevant major mode for the language
  • forcing font-lock of the entire buffer
  • cloning the font-lock information for the entire buffer back to Org

In essence, every keystroke in a babel block causes font-lock lag equal to opening the file for the first time. As you can imagine, this adds up.

I think ideally Org would monitor which block you=E2=80=99re executing keys= trokes in, and if there are a few in a row in the same org-src block keep the font-lock buffer alive and incrementally update the content and intelligently copy ba= ck font-lock changes. This has the potential to be much lower latency, but is = also going to be hard to get right.

In the meantime, you could try executing something like this in your Org buffer (source):

(setq-lo=
cal jit-lock-defer-time 0.05
            jit-lock-stealth-time 1)

This sacrifices immediate font-lock accuracy for responsiveness.

All the best,
Timothy

From: L=C3= =A9o Ackermann
Subject: Large source block causes org-mode to be unusable
To: emacs-orgmode@gnu.org
Date: Tue, 22 Jun 2021 02:27:52 +0800

Dear all,

I am working in an org-file = of reasonable size (<2000 lines): my first paper written in org-mode. Ev= erything fine (and fast) until I started to add `#+BEGIN_proof / #+END_proo= f` within my .org to make my .pdf export prettier. This caused the editing = of the proofs to be very slow: navigation within the proof is fast but addi= ng/removing any char takes around 4s per char.
It seems that the = fontify function is responsible for that (see screenshot). As far as I unde= rstand, this function tries to fontify the whole block as soon as a single = char is modified. In my case, it then tries to fontify a whole proof (~4 pa= ges in my .pdf, with many LaTeX formulas) several times per second...
=

Is there a way to make this fontify function to act &q= uot;around my cursor" ? 

Best,
Leo

--
Here the profiler's report whe= n adding a single char
3D"image.png"=
 Spec.
- Emacs 27.2 = (doom emacs 2.0.9) (I just updated them)


--==-=-=-- --=-=-=--