all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* bug#59738: c-ts-mode is slow with large buffers.
@ 2022-12-01 11:50 Alan Mackenzie
  2022-12-03 10:37 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Alan Mackenzie @ 2022-12-01 11:50 UTC (permalink / raw)
  To: 59738

Hello, Emacs.

In an up to date (2022-11-30) master started as $ emacs --no-desktop:

The file .../drivers/gpu/drm/amd/include/asic_reg/dce/dce_12_0_sh_mask.h
in the Linux source tree is 6.8 MB big, consisting of a large number of
#defines and comments, but nothing else.

To scroll through it in c-ts-mode takes a little over 26 minutes on my
system.  By comparison, in C Mode it takes 31 seconds.  There would
appear to be a need for some optimisation in c-ts-mode, here.


The file
https://gitlab.com/wireshark/wireshark/-/raw/master/epan/dissectors/packet-rrc.c
(see bug #45248) (10 MB) takes 578 seconds to scroll in c-ts-mode.  It
scrolls through the first 83% of the buffer rapidly, then chokes on a big
brace block initialisation.  Also, the font-locking fails part way
through this brace block (without any apparent speed up).

For comparison, the scrolling takes 30 seconds in C Mode.  There seems to
be a need for optimisation of c-ts-mode in this case, too.


For completeness, I used M-: (time-scroll) in the following for the
timings:

(defmacro time-it (&rest forms)
  "Time the running of a sequence of forms using `float-time'.
Call like this: \"M-: (time-it (foo ...) (bar ...) ...)\"."
  `(let ((start (float-time)))
    ,@forms
    (- (float-time) start)))

(defun time-scroll (&optional arg)
  (interactive "P")
  (message "%s"
           (time-it
            (condition-case nil
                (while t
                  (if arg (scroll-down) (scroll-up))
                  (sit-for 0))
              (error nil)))))


-- 
Alan Mackenzie (Nuremberg, Germany).





^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2023-01-07 23:08 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-01 11:50 bug#59738: c-ts-mode is slow with large buffers Alan Mackenzie
2022-12-03 10:37 ` Yuan Fu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-12-07  4:56 ` Yuan Fu
2022-12-07 17:23   ` Eli Zaretskii
2022-12-08  0:40     ` Yuan Fu
2022-12-08 20:37       ` Eli Zaretskii
2022-12-10 21:34         ` Alan Mackenzie
2022-12-10 23:14           ` Yuan Fu
2022-12-11  7:25             ` Eli Zaretskii
2022-12-11 13:22             ` Alan Mackenzie
2022-12-11 16:38               ` Dmitry Gutov
2022-12-11  6:45           ` Eli Zaretskii
2022-12-11 17:13             ` Alan Mackenzie
2022-12-11 17:38               ` Eli Zaretskii
2022-12-11 18:39                 ` Alan Mackenzie
2022-12-11 19:14                   ` Eli Zaretskii
2022-12-13  1:20           ` Stefan Kangas
2022-12-07 14:34 ` Eli Zaretskii
2022-12-07 14:58   ` Eli Zaretskii
2022-12-07 15:46   ` Alan Mackenzie
2023-01-07 23:08 ` Yuan Fu

Code repositories for project(s) associated with this external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.