emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Speedup on large file after reconfiguring whitespace-mode


From: Russell Adams
Subject: Speedup on large file after reconfiguring whitespace-mode
Date: Tue, 30 Jul 2024 15:12:50 +0200

I wanted to let others know about my recent experience tuning Org. I'm
on Emacs 29.3 with Org 9.7-pre from git.

I have a large file, 5MB, 134k lines, 4k example blocks, 1200 inline
images, 6500 timestamps. It grows rapidly as I use it for customer
support at a very active customer. I do try to archive completed tasks
twice a year to try and get it back under 100k lines.

I've had some performance problems with the file as it grows. Recently
I was trying to scroll up by just holding page up, and within seconds
Emacs would timeout and it could take up to 10 seconds being frozen
until it caught up.

I asked about this in the recent Org meetup, and I was given great
information about how the number of faces used in a file can strongly
influence the speed of navigation. I tested in fundamental mode and
still had slowdowns, and in emacs -Q it ran normally at full
speed. Something was up with faces.

I went to bisect my configuration. I don't use many packages, but I
dutifully bisected down all my use-packages calls until I had
none. The problem still persisted with no add-on packages.

I started digging into my configuration, and found that if I disabled
global-whitespace-mode the issue vanished. After some searches, it
appears that whitespace-mode highlights each space/tab/newline with a
face. In a small file that may not matter, but in bulk it was
crippling.

I changed whitespace-mode to use the display table where it
substitutes other characters for spaces instead of using faces, and the
performance problem was solved.

The following setting made all the difference:

(setq whitespace-style '(space-mark tab-mark))

Perhaps I can save someone else some time troubleshooting.

------------------------------------------------------------------
Russell Adams                            RLAdams@AdamsInfoServ.com
                                    https://www.adamsinfoserv.com/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]