GNU bug report logs - #66512
30.0.50; flymake with checkdoc slows down typing in large Elisp buffers

Previous Next

Package: emacs;

Reported by: Visuwesh <visuweshm <at> gmail.com>

Date: Fri, 13 Oct 2023 05:55:01 UTC

Severity: normal

Found in version 30.0.50

Full log


View this message in rfc822 format

From: Eli Zaretskii <eliz <at> gnu.org>
To: Visuwesh <visuweshm <at> gmail.com>
Cc: 66512 <at> debbugs.gnu.org
Subject: bug#66512: 30.0.50; flymake with checkdoc slows down typing in large Elisp buffers
Date: Sat, 14 Oct 2023 13:20:48 +0300
> From: Visuwesh <visuweshm <at> gmail.com>
> Cc: 66512 <at> debbugs.gnu.org
> Date: Sat, 14 Oct 2023 14:59:29 +0530
> 
> [வெள்ளி அக்டோபர் 13, 2023] Eli Zaretskii wrote:
> 
> >>     1. src/emacs -Q
> >>     2. C-x C-f lisp/org/org.el RET
> >>     3. M-x flymake-mode RET
> >>     4. M-g i org-drag-line-forward RET
> >>     5. Move the point to be inside the docstring, and start typing away.
> >>        You should notice the latency sooner or later.
> >> 
> >> I can reproduce this in my fairly long init.el file too (~10k lines) and
> >> I was forced to turn off checkdoc for the typing to be bearable in my
> >> init.el file.
> >
> > Thanks.
> >
> > This report needs more info:
> >
> >   . the file you used which produces this slowdown
> 
> I used org.el in the example.
> 
> >   . the profile is not fully expanded (some functions have "+")
> >   . for more detailed profile, please load the relevant Lisp files as
> >     *.el (not *.elc), and repeat the profiling
> >   . if the slowdown is visible in "emacs -Q", the profile from that is
> >     more important than the one from your customized Emacs
> 
> Here's the fully expanded profile after evaluating the checkdoc.el
> library in emacs -Q.  I also attached the file written by
> profiler-report-write-profile too.

Thanks.  It looks like the hot spots are:

   . the call to checkdoc-defun-info
   . this snippet from checkdoc-this-string-valid-engine:

     (save-excursion
       (forward-line 1)
       (beginning-of-line)
       (if (and (< (point) e)
		(looking-at "\\([ \t]+\\)[^ \t\n]"))
	   (if (checkdoc-autofix-ask-replace (match-beginning 1)
					     (match-end 1)
                                             "Remove this whitespace?"
					     "")
	       nil
	     (checkdoc-create-error
	      "Second line should not have indentation"
	      (match-beginning 1)
	      (match-end 1)))))
   
The rest is taken by GC, AFAICT.




This bug report was last modified 1 year and 245 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.