Closed moritzschaefer closed 6 months ago
@moritzschaefer It seems something problematic is going on with page-break-lines--update-display-tables
, since it appears so prominently in the profile above. I suggest you disable page-break-lines-mode
to see if the problem goes away.
I use the following small mode to achieve a similar effect as page-break-lines-mode
. You could give that a try.
(defun formfeed--fontify (beg end &optional unfontify)
(goto-char beg)
(while-let ((pos (search-forward "\f" end t)))
(funcall
(if (and (not unfontify) (eq pos (1+ (pos-bol))) (eq pos (pos-eol)))
#'add-text-properties #'remove-text-properties)
(1- pos) pos '(face (:strike-through t :inherit shadow)
display (space :width text)
rear-nonsticky t))))
;;;###autoload
(define-minor-mode formfeed-mode
"Prettify ^L form feeds."
:global nil
(cond
(formfeed-mode
(jit-lock-register #'formfeed--fontify))
(t
(jit-lock-unregister #'formfeed--fontify)
(formfeed--fontify (point-min) (point-max) t)))
(jit-lock-refontify))
Also, in case that doesn't help, you could try using PDF-tools if you aren't already. I believe it uses a faster display engine than the built-in PDF viewer. It might not show up in the profiler. As for the images, I'm getting massive slowdown with large images also, but I think this is due to Emacs, not EXWM.
Thank you for your comments!
The problem comes and goes (e.g. when I close the PDF and open it again, the issue goes away for some time).
I also once deactivated each of the minor modes sequentially (including page-break-lines-mode), but the problem persisted. I do use pdf-tools already, so nothing to gain hear I am afraid.
I'll try your script @minad, thanks!
When opening large PDFs and images, switch to and back from the image-containing workspace is horribly slow (every keystroke takes seconds, including opening of
which-key
). This seems to be cause by the image being visible as everything runs smooth, when the image/PDF is invisible. Furthermore, the slowdown seems to be proportional to the file size.htop
shows 100% CPU usage by emacs, which seems to be attributable to a high number ofredisplay_internal
calls. Can I somehow find out what exactly triggers the excessive number of redisplay calls?The slow-down also leads to thes warning:
⛔ Warning (emacs): [XELB] Retrieve reply timeout
, which is why I suspect it has to do with EXWM itself?Profile
I profiled while switching back and forth between workspaces (one of them containing a large image or PDF)
CPU
Notably: page-break-lines-mode is inactive in the image/PDF. I suspect it gets called in a non-PDF buffer
Mem:
Any support would be highly appreciated (this is bugging me for years really). If this is likely not to be EXWM-related, I'll move on to spacemacs support.