'leiningen' related commands too slow with Mac OS X

邮差的信 提交于 2019-12-23 12:23:07

问题


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.


回答1:


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.




回答2:


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.




回答3:


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.



来源:https://stackoverflow.com/questions/3359388/leiningen-related-commands-too-slow-with-mac-os-x

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!