Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

deft mode terribly slow

Tags:

emacs

emacs24

I just started using emacs24 (the one that comes with Ubuntu) in order to use deft mode to mimic the behavior of notational velocity on the Mac. My ~/.emacs-d/init.el looks like this:

(add-to-list 'load-path "~/.emacs.d")
(require 'deft)
(setq deft-directory "~/Notes")
(setq deft-use-filename-as-title t)

in order to load my folder with txt files. I have a few thousand text files in the folder with file names that include CJK characters. Now, running deft mode is now /extremely/ slow, it's impossible to even type to search among the files. After typing a word I have to wait for several minutes before it shows up on the screen and searches through the notes. Even turning emacs off takes a long time. My computer is a Lenovo W540 64-bit i7-4800MQ CPU @ 2.70GHz × 8 and 23.2 GiB memory (it tells me). I'm running Ubuntu 14.04. What might be wrong with my emacs?

I'm new to emacs and frankly I don't even understand what I just wrote above, I'm just trying to piece the setup I want together from tutorials I find online, so forgive any stupidities that might have slipped into my question. Thanks in advance!

like image 738
Mårten Avatar asked Mar 20 '23 19:03

Mårten


1 Answers

I'd be happy to be proven wrong, but I don't think deft is intended to work with "a few thousand text files"! You would surely want some kind of specialised indexing and searching tool to efficiently work with that quantity of data.

I'm a bit out of date, but I believe deft is just opening the files in Emacs and using regexp searching to find matches (which is just fine for smaller numbers of files, but it doesn't scale to your use-case).

The only suggestion I can make is to ensure that deft.el is byte-compiled (i.e. you have a deft.elc file). Use M-x byte-compile-file otherwise. But even if you're currently using an uncompiled version, I don't believe that is going to provide the sort of performance improvements you'd need to make this a viable solution.

like image 110
phils Avatar answered Mar 29 '23 00:03

phils