views:

122

answers:

3

I installed and run lein, but it seems to slow on My Mac (10.6.4).

Running 'time lein help' gives me

real    11m8.674s
user    0m54.297s
sys 1m32.621s

I tried once more.

real    15m25.560s
user    1m36.087s
sys 2m52.745s

What's wrong with this? Is anyone experiencing similar problem? Is there anyway to check what's the problem?

Added

When I install, I used 'sudo lein deps', as I got some errors using 'lein deps'. I guess it caused some problem accessing files. When I run 'sudo lein SOMETHING', it works as usual.

+6  A: 

One thing to note is that it will put the src directory on the classpath. If you run it from $HOME and have a 54GB ~/src directory like I do, the JVM will slow to a crawl just trying to find the basic things.

technomancy
A: 

Found solution

sudo lein uses different CLASSPATH than that with just lein. I guess my CLASSPATH that contains clojure or clojure-contrib conflicted with the lein.

When I added this code at line 126 of lein, the problem is gone.

CLASSPATH="/Users/smcho/.m2/repository/leiningen/leiningen/1.2.0/leiningen-1.2.0-standalone.jar:lib/dev/swank-clojure-1.2.1.jar::src/:" 

For uninstalling/installing, I asked and got an answer here.

prosseek
+1  A: 

It's because of how it looks for hooks. It's explained here: http://groups.google.com/group/clojure/browse_thread/thread/e04ab3f6e17f85c4.

You could give cake a try. It worked out of the box for my simple project.clj without any changes, and is blazing fast because of the persistent JVM it uses.

daaku
@daaku : Do you know how to stop the cake when I'm done with it? I could use ps aux | grep cake to kill -9 all the processes, but there might be a better way.
prosseek
@daaku : I tested with cake, it's faster but not dramatically faster. Thanks for the info.
prosseek
You can do `cake stop` to kill the processes.
daaku