Skip to content

Commit cf2d968

Browse files
committed
Improve performance of inf-clojure--process-response and close #89
Introduce double checking in the busy wait that detects if the inf-clojure process (the REPL) has completed and sent back everything. This removes the slowness that was triggered by having accept-process-output in the while body: we can take advantage now of its output to wait as well.
1 parent c4dac2d commit cf2d968

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
* [#79](https://github.com/clojure-emacs/inf-clojure/pull/82): Eldoc error when running boot repl.
88
* [#83](https://github.com/clojure-emacs/inf-clojure/pull/85): No such namespace: complete.core in lumo REPL.
9+
* [#93](https://github.com/clojure-emacs/inf-clojure/pull/93): Slow response from inf-clojure (completions, arglists, ...).
910

1011
## 2.0.1 (2017-05-18)
1112

inf-clojure.el

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -995,8 +995,9 @@ the `inf-clojure-prompt`."
995995
(inf-clojure--sanitize-command command) work-buffer process nil t)
996996
;; Wait for the process to complete
997997
(set-buffer (process-buffer process))
998-
(while (null comint-redirect-completed)
999-
(accept-process-output nil 1))
998+
(while (and (null comint-redirect-completed)
999+
(accept-process-output process 1 0 t))
1000+
(sleep-for 0.01))
10001001
;; Collect the output
10011002
(set-buffer work-buffer)
10021003
(goto-char (point-min))

0 commit comments

Comments
 (0)