Skip to content

Commit f7ec13a

Browse files
arichiardibbatsov
authored andcommitted
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 49b8c4b commit f7ec13a

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
@@ -996,8 +996,9 @@ the `inf-clojure-prompt`."
996996
(inf-clojure--sanitize-command command) work-buffer process nil t)
997997
;; Wait for the process to complete
998998
(set-buffer (process-buffer process))
999-
(while (null comint-redirect-completed)
1000-
(accept-process-output nil 1))
999+
(while (and (null comint-redirect-completed)
1000+
(accept-process-output process 1 0 t))
1001+
(sleep-for 0.01))
10011002
;; Collect the output
10021003
(set-buffer work-buffer)
10031004
(goto-char (point-min))

0 commit comments

Comments
 (0)