reddit / emacs

How to speed up opening of large files in Doom Emacs?

zajasu · 2022-02-01 09:35
I have a 35Mb csv file. Opening it takes too much time in Doom Emacs, while in vanilla Emacs it is opened instantly. I ran profiler and presumably it is related to the vertico--advice, but I'm not an expert in profiler. Does anyone knows how to debug this behavior or maybe there is some built-in mode which is turned on in Doom by default, or there might be some setting which I need to turn on/off for large files?
Hastrack · 2022-02-01 09:45
Doom Emacs lazy load everything to make the startup quicker, so I think that's a normal behavior. You could see what is in the csv hook, but I don't know if that would help much
vecksagos · 2022-02-01 18:01
You can use [vlf](https://github.com/m00natic/vlfi) package to open large files
zajasu · 2022-02-02 08:50
35Mb is not that much + it works fine with vanilla emacs
four0nine · 2022-02-06 17:50
If it's getting slow, it could be related to one of the modes enabled. One way to make sure that large file don't get too slow is this (i don't remember were i got it from) ``` (defun my-find-file-check-make-large-file-read-only-hook () "If a file is over a given size, make the buffer read only." (when (> (buffer-size) (* 1024 1024)) (setq buffer-read-only t) (buffer-disable-undo) (fundamental-mode) (linum-mode -1) (font-lock-mode -1) ) ) (add-hook 'find-file-hook 'my-find-file-check-make-large-file-read-only-hook) ```