17

I have been using csv-mode to modify small to medium sized CSV files, but recently I have been working with large files containing more than 40,812 entries. csv-mode struggles to align and navigate the tables, and is too slow to be usable as is. In comparison, LibreOffice Calc can zip through the file.

Is there a simple way to make csv-mode handle large tables, or is there a better approach available?

I am aware of a related Stack Overflow question. Its solution was to only align the portion of buffer in the visible window, but this did not solve the sluggishness in my case.

Here is an example file. I tried to make it large, but not so large it will freeze Emacs on older computers.

holocronweaver
  • 1,319
  • 10
  • 22

1 Answers1

13

With csv-mode I can see some lags with your file, but only with syntax highlighting enabled. After disabling fontification with M-x font-lock-mode it works without problems.

To disable it permanently for csv-mode add to your config:

(add-hook 'csv-mode-hook (lambda () (font-lock-mode -1))

Or if you are a use-package user:

(use-package csv-mode
  :mode ("\\.csv\\'" . csv-mode)
  :init (add-hook 'csv-mode-hook (lambda () (font-lock-mode -1)))
  :ensure t)
kmicu
  • 2,395
  • 1
  • 15
  • 15
  • 2
    After disabling `font-lock-mode`, `company-mode`, and a couple other minor modes, speed improved considerably! I consider this a major success. – holocronweaver Oct 31 '14 at 22:40
  • 5
    I would even consider wrapping this to only apply to large files: `(when (> (point-max) some-large-number) (font-lock-mode -1))` – Sean Allred Nov 01 '14 at 01:34