summary refs log tree commit diff
diff options
context:
space:
mode:
authorFranck Cuny <franck.cuny@gmail.com>2020-03-21 13:18:46 -0700
committerFranck Cuny <franck.cuny@gmail.com>2020-03-21 13:18:46 -0700
commit2830c9ee4a39a06c4c295367705905f4e5a2bc31 (patch)
treefc938aee338a3515e1bef1da56ed2f6f4d3b22f7
parentelfeed: one more blog (diff)
downloademacs.d-2830c9ee4a39a06c4c295367705905f4e5a2bc31.tar.gz
magit: improve performance for magit in large repo
Opening a file in source is extremely slow, and I'm guessing it's
related to git/magit, since I don't see this elsewhere. As suggested in
https://magit.vc/manual/magit/Performance.html and
https://magit.vc/manual/magit/Per_002dRepository-Configuration.html, I'm
disabling git from VC's backend, and disable refreshing the magit buffer
for source.
-rw-r--r--emacs.d/custom/fcuny-git.el14
1 files changed, 14 insertions, 0 deletions
diff --git a/emacs.d/custom/fcuny-git.el b/emacs.d/custom/fcuny-git.el
index eb43040..088b895 100644
--- a/emacs.d/custom/fcuny-git.el
+++ b/emacs.d/custom/fcuny-git.el
@@ -19,4 +19,18 @@
   (git-commit-summary-max-length 50)
   (fill-column 72))
 
+;; https://magit.vc/manual/magit/Per_002dRepository-Configuration.html
+;; we don't want to refresh buffers in source. This should help with
+;; performances.
+(dir-locals-set-class-variables 'huge-git-repository
+                                '((nil . ((magit-refresh-buffers . nil)))))
+
+(dir-locals-set-directory-class
+ "/Users/fcuny/workspace/source" 'huge-git-repository)
+
+;; https://magit.vc/manual/magit/Performance.html
+;; disable Git from the VC mode, since we use magit. This should help
+;; with performances.
+(setq vc-handled-backends (delq 'Git vc-handled-backends))
+
 (provide 'fcuny-git)