Help needed with slowdown during editing

26 views
Skip to first unread message

Plamen

unread,
Feb 12, 2017, 7:24:35 PM2/12/17
to cur...@googlegroups.com
Hello Colin,

since a couple of days I experience a substantial slowdown in the editor for a specific type of a Clojure function. Yes :)

I have a project with several files and I experience the editing as smooth in all other files. In that specific file I can comfortably edit source in/around all functions/macros except in one.

Now - this one looks a bit like that (it is a part of some code generator - that’s why such a pattern):

(defn emit-some-source [input ...]
(let [...
sym-a ...
sym-b ...
efn `(do
(defn ~(symbol (name ...)) [~sym-a ...]
~(let [...]
`(let [~sym-c ...]
~(if ...
(let [...]
`(do
(let [...]
(as-> ~sym-d ~sym-e
(somefn [~@(...)] ~sym-... ~sym-... ~sym-...)
(somefn2 [~@(...)] ~sym-... ~sym-... ~sym-...)
(somefn3 [~@(...)] ~sym-... ~sym-... ~sym-...)
~(if ...
`(let [...]
...
))))))
(do
`(let [...]
(as-> ...
(somefn [~@(...)] ~sym-... ~sym-... ~sym-...)
(somefn2 [~@(...)] ~sym-... ~sym-... ~sym-...)
(somefn3 [~@(...)] ~sym-... ~sym-... ~sym-...)
~(if ...
`(let [...]
...)
...)))
))))))]
...
))
If I try to just type somewhere in the middle of that a code, then the IDE freezes for several seconds and then prints several characters at once, to the point that it is uneditable. I assume that the lot of quoting/backquoting require more involved work in Cursive. It worked actually until few days ago - this code experienced several refactoring without problems in Cursive. There has been no update from Cursive in the meantime, but I remember to have updated to IntelliJ 2016.3.4 last week, just don’t remember before or after the slowdown. So - if you edit the actual example above, Cursive will work without problems - but in the actual code there are about 40 symbols and another 20 vars, several functions have around 10 parameters, so it feels like I have hit some threshold on the number of nested levels of back quoting and/or symbols. Again - editing other functions/macros in the same or other files doesn’t seem to affect Cursive, but they don’t have that much levels of nesting and number of symbols.

Can you help? (I would immensely value if I don’t have to refactor it in Emacs or elsewhere, as this layout/pattern of the code aligns well with the problem and the code remains readable).

If you need the actual source code, please leave me an e-mail address on which I should send it.

With best regards
Plamen



Colin Fleming

unread,
Feb 12, 2017, 10:17:15 PM2/12/17
to cur...@googlegroups.com
Hi Plamen,

If it would be possible to send me the source code, that would be very useful. Could you send it to cur...@cursive-ide.com, and I’ll take a look?

Thanks,
Colin


--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/cursive/235D1F75-6B63-4A78-8009-BE5853D31C44%40gmail.com.
For more options, visit https://groups.google.com/d/optout.

tar

unread,
Feb 13, 2017, 7:11:47 AM2/13/17
to Cursive
Hi, in the past I have experienced slowdowns that sound like what you're describing, and eventually found that they happen when a Cursive REPL has a lot of output. I have not seen it happen for a couple months but maybe check that you're clearing out the REPL scrollback history periodically.

Plamen

unread,
Feb 13, 2017, 7:18:07 AM2/13/17
to cur...@googlegroups.com
Hello,

thank you for the suggestion. I have the same too and already clearing the outpu periodically, but this problem seems to be unrelated.

I sent Colin already the actual source.

With best regards
Plamen


--
You received this message because you are subscribed to the Google Groups "Cursive" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cursive+u...@googlegroups.com.
To post to this group, send email to cur...@googlegroups.com.

Colin Fleming

unread,
Feb 13, 2017, 3:39:56 PM2/13/17
to cur...@googlegroups.com
Yes, this was a bug that I fixed recently: https://groups.google.com/d/topic/cursive/esTWuQUG3gs/discussion

Reply all
Reply to author
Forward
0 new messages