From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan L Tyree Subject: Re: footnote fontify causing massive slowdown Date: Sun, 06 Dec 2015 08:40:58 +1100 Message-ID: <566359EA.4070105@gmail.com> References: <87egf1qcgn.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:50930) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5KZg-0003i6-Tx for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 16:41:02 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a5KZd-0004P3-Lc for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 16:41:00 -0500 Received: from mail-pa0-x233.google.com ([2607:f8b0:400e:c03::233]:33209) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a5KZd-0004Oz-Fm for emacs-orgmode@gnu.org; Sat, 05 Dec 2015 16:40:57 -0500 Received: by pabfh17 with SMTP id fh17so107145121pab.0 for ; Sat, 05 Dec 2015 13:40:56 -0800 (PST) Received: from [192.168.1.1] (202.63.32.163.static.rev.eftel.com. [202.63.32.163]) by smtp.googlemail.com with ESMTPSA id dg1sm23025153pad.18.2015.12.05.13.40.54 for (version=TLSv1/SSLv3 cipher=OTHER); Sat, 05 Dec 2015 13:40:56 -0800 (PST) In-Reply-To: <87egf1qcgn.fsf@nicolasgoaziou.fr> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org On 05/12/15 23:58, Nicolas Goaziou wrote: > Hello, > > Derek Feichtinger writes: > >> While diagnosing a server condition, I was listing parts of a system log >> via a babel expression. The 130 lines in the babel output are wrapped in >> an example block. This block caused massive slowdown of scrolling and >> other operations. >> >> Using the emacs profiler I see: >> >> - redisplay_internal (C function) 8232 88% >> - jit-lock-function 8226 88% >> - jit-lock-fontify-now 8226 88% >> - funcall 8226 88% >> - # 8226 88% >> - run-hook-with-args 8226 88% >> - font-lock-fontify-region 8226 88% >> - font-lock-default-fontify-region 8226 88% >> - font-lock-fontify-keywords-region 8226 88% >> - org-activate-footnote-links 8158 87% >> - org-footnote-next-reference-or-definition 8158 87% >> - byte-code 8158 87% >> - org-footnote-at-reference-p 4114 44% >> - org-footnote-in-valid-context-p 4106 44% >> + org-inside-LaTeX-fragment-p 2380 25% >> + org-in-block-p 1563 16% >> + org-in-verbatim-emphasis 159 1% >> org-at-comment-p 4 0% >> >> Checking for footnote pattern matches (org-footnote-re) in the wrapped >> block, I see that >> every line matches based on the very simple and trivial pattern of >> number enclosed in angular brackets, so all the process numbers >> following the "sshd" in these lines like "sshd[1234]" do match and cause load. >> >> ################# >> /var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts >> authentication refused for userXYZ: bad ownership or modes for home directory. >> /var/log/secure-20151129:Nov 23 02:25:36 some-host sshd[20089]: Rhosts >> authentication refused for userXYZ: bad ownership or modes for home directory. >> /var/log/secure-20151129:Nov 23 02:25:41 some-host sshd[20089]: >> pam_ldap: error trying to bind as user "xxxxx" (Invalid credentials) >> ################# >> >> Since this kind of pattern is so common in logs and 130 lines are really not >> a large number, it makes it hard to use >> org for this purpose. Can this be turned off selectively, or can it be >> prevented in example blocks? > This is a limitation of our current way to fontify a buffer. Changing it > implies some serious work, which I'd rather spend on switching to > syntax-based (instead of regexp-based) fontification. > > However, this report raises an interesting question about footnotes: > should we still support plain (e.g., "[1]") footnotes in Org documents? > > The pattern is very common an regularly introduces false positives. > Also, IIRC, it was introduced for non-Org buffers (e.g., in Message mode > buffers), to provide some common features with "footnote.el" library. > > I think we could remove this kind of footnotes, and yet preserve > `org-footnote-normalize' to change Org footnotes into these ones, for > foreign documents. > > WDYT? > > > Regards, > I would be delighted to see the 'plain' footnote format abolished. I use org for writing legal text which often has things like Bank of New South Wales v Laing [1954] AC 135. Rasmus helped me with a patch to ignore these kinds of references, but they remain a nuisance. Special case, I know, but +1 for getting rid of the things. Cheers, Alan -- Alan L Tyree http://www2.austlii.edu.au/~alan Tel: 04 2748 6206 sip:typhoon@iptel.org