3

When I load some log files (50mb) When it has long json contents, emacs becomes unbearably slow.

Note the log file is simply text file which happened to have json content.

So json mode is not on.

Is there a way to turn off every formatting or other computing in emacs?
Just open a text file without any processing - mode?

4

Emacs is often slow on any file with long lines. Improving its performance is not too hard though.

I think that the easiest way to improve performance is to enable global-so-long-mode. Add this to your init file:

(if (version<= "27.1" emacs-version)
    (global-so-long-mode 1))

Edit: If you’re using an old version of Emacs, then the easiest thing to do is to install and configure the so-long package from ELPA. You should also upgrade to the most current version of Emacs, but that’s a separate matter.

2
  • .... assuming the OP has an Emacs version greater or equal to 27.1. If not, then isn't the standard recommendation to turn off global font-lock-mode?
    – NickD
    May 5 at 11:59
  • so-long supports Emacs 24.4 and above. It's true that disabling font-lock frequently has the most impact (so that's one of the more important things that so-long does by default), but I think one may as well just install and use the library.
    – phils
    Jun 14 at 11:58
2

You can open your file with M-x find-file-literally.

Moreover you can use the vlf package https://github.com/m00natic/vlfi

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.