unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Visuwesh <visuweshm@gmail.com>
Cc: 66512@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	[thread overview]
Message-ID: <834jitsdxb.fsf@gnu.org> (raw)
In-Reply-To: <87h6mt7ds6.fsf@gmail.com> (message from Visuwesh on Sat, 14 Oct 2023 14:59:29 +0530)

> From: Visuwesh <visuweshm@gmail.com>
> Cc: 66512@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.





      reply	other threads:[~2023-10-14 10:20 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-13  5:53 bug#66512: 30.0.50; flymake with checkdoc slows down typing in large Elisp buffers Visuwesh
2023-10-13  6:37 ` Eli Zaretskii
2023-10-14  9:29   ` Visuwesh
2023-10-14 10:20     ` Eli Zaretskii [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=834jitsdxb.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66512@debbugs.gnu.org \
    --cc=visuweshm@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).