My understanding is that, by default, CIDER loads quite a bit of middleware 
when it connects so that’s likely the cause of the slowdown. You can override 
the middleware to provide a more stripped-down experience (but you’ll lose a 
lot of CIDER’s functionality) – check the CIDER docs for that.

 

Sean Corfield -- (970) FOR-SEAN -- (904) 302-SEAN
An Architect's View -- http://corfield.org/

"If you're not annoying somebody, you're not really alive."
-- Margaret Atwood

 

On 8/31/16, 10:28 AM, "Gregg Reynolds" <clojure@googlegroups.com on behalf of 
d...@mobileink.com> wrote:

 

Hi,

 

I'm having some trouble connecting from a Mac to an nREPL running on an Intel 
Edison.  I'm using boot to launch the nREPL on the Edison; it's *very* slow to 
launch (~2 minutes 15 seconds), which is not too surprising since the Edison is 
a relatively constrained device (1 Mb RAM, Atom CPU at 500 MHz).  But 
connecting to the nREPL with cider-connect is also painfully slow (~75 
seconds).  By contrast, connecting via ssh is quite fast.  

 

Does it make sense that connecting is so slow?  I would think that once the JVM 
and Clojure are up and running connecting should not be so sluggish.

 

I'm not sure where to direct this question which is why I'm posting to the 
general list.  At first I thought is was a Cider problem but now I'm not so 
sure.  Maybe its an nREPL issue?  Any suggestions?

 

I'm using Clojure 1.7.  Would upgrading make any difference?

 

Note that there are three ways to connect to an Edison. It has two USB ports; 
one functions as a serial line you can use to connect using screen, the other 
functions as an IP-over-USB line (192.168.2.15 on if usb0; this works 
out-of-the-box on OS X, might need some configuration on other platforms).  If 
you connect it to a WiFI network you get a third IP on interface wlan0.

 

If I cider-connect to edison2.local (I named my device 'edison2'), cider tries 
to establish a direct connection.  If I cider-connect to 192.168.2.15 it tries 
direct connection; using WiFi IP (e.g. 192.168.1.206), cider tries to establish 
an ssh tunnel.  In all cases I get the spinning beachball for well over a 
minute.

 

I can cancel the spinning beachball so it isn't totally hung.

 

Once a connection is established, the nREPL is quite snappy.

 

## Steps to reproduce the problem

 

Connect to the Edison via the serial line (i.e. screen -L /dev/cu.usbserial... 
115200 -l) and launch the nREPL using boot (details below).

 

On the Mac host, open a simple clj file in Emacs, cider-connect (C-c M-c) using 
any of the hosts mentioned above.

 

Thanks,

 

Gregg

 

## Environment & Version information

 

### CIDER version information

 

```

;; Connected to nREPL server - nrepl://localhost:8088

;; CIDER 0.13.0 (California), nREPL 0.2.12

;; Clojure 1.7.0, Java 1.8.0-internal

```

 

### Boot version

 

~/.boot/profile.boot:

 

(deftask cider "CIDER profile"

  []

  (require 'boot.repl)

  (swap! @(resolve 'boot.repl/*default-dependencies*)

         concat '[[org.clojure/tools.nrepl "0.2.12"]

                  [cider/cider-nrepl "0.13.0"]

                  #_[refactor-nrepl "2.2.0"]])

  (swap! @(resolve 'boot.repl/*default-middleware*)

         concat '[cider.nrepl/cider-middleware

                  #_refactor-nrepl.middleware/wrap-refactor])

  identity)

 

Launch cmd:  `$ boot cider repl`  (this takes a long time, like a couple of 
minutes)

 

nREPL startup msg:

 

nREPL server started on port 8088 on host 127.0.0.1 - nrepl://127.0.0.1:8088

REPL-y 0.3.7, nREPL 0.2.12

Clojure 1.7.0

OpenJDK Server VM 1.8.0-internal-neck_2016_06_06_15_38-b00

 

### Emacs version

 

Emacs 24.5.1 (x86_64-apple-darwin13.4.0, NS apple-appkit-1265.21)

 

clojure-mode-display-version:  clojure-mode (version 5.5.2)

 

### Operating system

 

Emacs running on OS X 10.11.5

 

nREPL running on Intel Edison:

 

edison2:~/nrepl$ uname -a

Linux edison2 3.10.98-poky-edison+ #1 SMP PREEMPT Mon Jun 6 14:32:08 PDT 2016 
i686 GNU/Linux

 

-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to