From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs 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 Message-ID: <834jitsdxb.fsf@gnu.org> References: <87r0lz6pb8.fsf@gmail.com> <83edhzt4cw.fsf@gnu.org> <87h6mt7ds6.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="7881"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66512@debbugs.gnu.org To: Visuwesh Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Oct 14 12:22:05 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qrbmX-0001oC-HA for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 14 Oct 2023 12:22:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qrbmD-0003B8-8B; Sat, 14 Oct 2023 06:21:45 -0400 Original-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 1qrbm7-0003B0-QA for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 06:21:40 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qrbm6-0007qn-M2 for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 06:21:39 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qrbmT-0002lx-Ol for bug-gnu-emacs@gnu.org; Sat, 14 Oct 2023 06:22:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 14 Oct 2023 10:22:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66512 X-GNU-PR-Package: emacs Original-Received: via spool by 66512-submit@debbugs.gnu.org id=B66512.169727888210585 (code B ref 66512); Sat, 14 Oct 2023 10:22:01 +0000 Original-Received: (at 66512) by debbugs.gnu.org; 14 Oct 2023 10:21:22 +0000 Original-Received: from localhost ([127.0.0.1]:47945 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrblq-0002kf-9p for submit@debbugs.gnu.org; Sat, 14 Oct 2023 06:21:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39098) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qrbll-0002kQ-IM for 66512@debbugs.gnu.org; Sat, 14 Oct 2023 06:21:21 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qrblI-0007b9-Ju; Sat, 14 Oct 2023 06:20:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=fU8CrD2va+yYh+rRtEFlv4JemFR63ZCozvHM/200EjA=; b=olmTGFMmqb8WXIOwiZNL Gk4JECG6iWzol+5mFjmOdC75+WTGjR+g0TcEzMu1sJnpEe8z+8CnlAD7C9Cb1LwsE27U8FNHaJT5P 5eGU7W4BYJDAfKvqU8iODesjulgAyXYHgMPTsfb6EWJE0LDwtNGf+Sg9EV/htZsAP1IwHzorjY3+9 UxZHlzgExDuOtDY/9MO805W18BZZdFX1WA5mjAQitRxJlA2Bfd2dvQaZtLd4aSosybJhc9yFjsGYF KHQp4lqMkq0gAvDfNBDR6RX3pIOe8Jde+I/gOBWSkJ2bfkQtfoszHm17gMVy1A0z1oPLIvvbr9WZo VHQKLwBcJHXZnw==; In-Reply-To: <87h6mt7ds6.fsf@gmail.com> (message from Visuwesh on Sat, 14 Oct 2023 14:59:29 +0530) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272399 Archived-At: > From: Visuwesh > 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.