I'm trying to debug emacs scrolling issues in long files, this elisp[0] doesn't seem to benchmark the redrawing or slownesses and claims "Elapsed time: 0.000003s". I'm guessing this is because of the problem residing in the display engine that is written in C?
I'm also trying to follow how scroll-up-command passes values or sends arguments to the display engine so I know where to start profiling it and digging deeper into this problem.
When I get the following cpu report, it's not clear where/how the display engine is called:
- command-execute 3526 99%
- call-interactively 3526 99%
- funcall-interactively 3147 88%
- scroll-up-command 2900 81%
- apply 2900 81%
- #<compiled 0x8db10b> 2900 81%
- apply 2896 81%
#<compiled 0x22d001> 2896 81%
How do I begin to debug these compiled functions? How do I trace the context/variables that apply might send to the display engine?
Thanks in advance for any help.
0: elisp code
(defun test-long-line-scrolling (n)
(with-selected-window (get-buffer-window "long-lines-file-test-emacs.txt")
(goto-char (point-max))
(dolist '(number-sequence 0 n)
(scroll-down))))
;; TODO: lookup how benchmark works
(benchmark 10 (test-long-line-scrolling 100))