]> code.delx.au - gnu-emacs-elpa/commitdiff
company-clang--start-process: Bind process-adaptive-read-buffering to nil
authorDmitry Gutov <dgutov@yandex.ru>
Sun, 7 Dec 2014 02:59:15 +0000 (04:59 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Sun, 7 Dec 2014 02:59:15 +0000 (04:59 +0200)
This speeds up completion on my system when a lot of candidates are returned, by
a factor of 2.5 (#228).

Inspired by https://github.com/Sarcasm/irony-mode/issues/131#issuecomment-60008803.

company-clang.el

index 90757a84b957f52a05111d8ddf4333d67f1b7220..f30bf1493dddb48ecec10c97538f5f40c8cd4c66 100644 (file)
@@ -182,7 +182,8 @@ or automatically through a custom `company-clang-prefix-guesser'."
 
 (defun company-clang--start-process (prefix callback &rest args)
   (let ((objc (derived-mode-p 'objc-mode))
-        (buf (get-buffer-create "*clang-output*")))
+        (buf (get-buffer-create "*clang-output*"))
+        (process-adaptive-read-buffering nil))
     (with-current-buffer buf (erase-buffer))
     (if (get-buffer-process buf)
         (funcall callback nil)