-
-
Notifications
You must be signed in to change notification settings - Fork 645
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cider-eval-region has catastrophic performance #1962
Comments
@cskksc Can you look into this when you have some time? |
It's the overlays. The same ones are being created continuous; I think you have creating a quadratic number of them. Using my reproduction case this is a print out of all the overlays in buffer after evaluating the first ten forms.
Will pick further. |
Overlays were broken for a bit because clojure core was missing from the ns cache. This was fixed clojure-emacs/cider-nrepl@fbc326d in cider-nrepl. It's possible that this wasn't font locking much in the old version that "worked" and now is correctly font locking so is taking a long time. You could verify this by setting |
Multiple identical fringe overlays were being placed by overlays were being added to the entire region for every interactive eval in that region. Add check in cider-interactive-eval-handler, so only first value adds fringe overlays. Remove all fringe overlays in region before placing new ones. Addresses clojure-emacs#1962
@dpsutton No, the bug was Emacs side -- top showed nothing for Java, 100% CPU for Emacs. Alas, overlays are rather easy to break Emacs with; they don't garbage collect cleanly and really slow the buffer down. |
On the Java side, we return what to font lock. It wasn't returning clojure
core stuff for font locking. My guess is that Emacs is locking up because
it has so much to font lock after the fix.
…On Mar 18, 2017 5:14 PM, "Phil Lord" ***@***.***> wrote:
@dpsutton <https://github.com/dpsutton> No, the bug was Emacs side -- top
showed nothing for Java, 100% CPU for Emacs. Alas, overlays are rather easy
to break Emacs with; they don't garbage collect cleanly and really slow the
buffer down.
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1962 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGFPTbwnxJEWLkgm36SL09HjoUp0qUwvks5rnFdCgaJpZM4MhfvR>
.
|
My suspicion was off base. I am totally wrong on this one. |
Multiple identical fringe overlays were being placed by overlays were being added to the entire region for every interactive eval in that region. Add check in cider-interactive-eval-handler, so only first value adds fringe overlays. Remove all fringe overlays in region before placing new ones. Addresses clojure-emacs#1962
Multiple identical fringe overlays were being placed by overlays were being added to the entire region for every interactive eval in that region. Add check in cider-interactive-eval-handler, so only first value adds fringe overlays. Remove all fringe overlays in region before placing new ones. Addresses #1962
This is already fixed. |
I find that cider-eval-region has catastrophic performace, when evaling
largish areas. In worst case it locks up Emacs in a way that Ctrl-G cannot
recover from.
This is true with the current release and with master.
Reproduction. Eval this code (in Emacs!).
#+begin_src elisp
(defun aaa()
(interactive)
(loop for i from 1 to 1000 do
(insert
(format "(defn a%s [])\n\n" i))))
#+end_src
Open a new clojure file, start cider, run M-x aaa. Then M-x
mark-whole-buffer, M-x cider-eval-region. The eval messages start up quite
quickly, then get very slow and Emacs becomes unrecoverable.
Interestingly, this is a regression. I tried with this commit:
commit 21b5857
Author: Chaitanya Koparkar ckoparkar@live.in
Date: Mon Apr 25 21:27:31 2016 +0530
And everything worked swimmingly (evaling in a second or so). There is nothing
magic about this commit -- I just noticed that I got different performance on
different computers, and it turned out to be because one Emacs had an old
version of cider at this commit.
Environment & Version information
CIDER version information
;; CIDER 0.13.0snapshot (package: 0.14.0), nREPL 0.2.12
(Also cider-latest from MELPA-stable!)
Lein/Boot version
lein 2.7.1
Emacs version
Emacs-25 HEAD
Operating system
Ubuntu 16.04
The text was updated successfully, but these errors were encountered: