On Fri, May 11, 2012 at 2:33 PM, Stuart Sierra
<the.stuart.sie...@gmail.com> wrote:
> I have a large-ish Clojure project that involves a lot of network servers
> and background threads. It's difficult to work on a program like this by
> reloading code at the REPL, because old background threads may still be
> running with old code.

Don't the ^:dynamic changes in 1.3 also include code to
forward-propagate recompiled defns to call sites that use them? So I
think restarting should only be necessary if AOT'd code has changed or
if you want to ensure you don't have any stray defns that don't exist
on disk any more. Though I suppose this is not true of HOFs. I wonder
if a macro would be helpful here to check the value of a system
property like "clojure.interactive" and go through a var if it's true
but use a direct function reference if not. (Dynamicity knobs in
action again?)

> From a clean start, `lein repl` takes 25 seconds to get to the first prompt.
> That's a long time during development.

Do you know if it takes about the same amount of time on Linux? I've
heard Mac users complain about slowdowns that I have been unable to
reproduce myself before, though that was a long time ago.

> What if I omit Leiningen altogether? First, generate the classpath:
>
>     lein classpath > target/classpath
>
> Then call Java directly:
>
>     java -cp `cat target/classpath` clojure.main -i src/my_project/main.clj -r

Leiningen 2 is using nrepl, so some of the overhead could come from
there. How long does `lein trampoline run -m clojure.main/main` take?
Have you tried swank-clojure?

> Running Java with '-XX:+TieredCompilation' took off another half second.
> Adding '-client' had no visible effect.

For what it's worth, tiered compilation should have the same effect as
-client; the latter is still there only for JVMs that are too old to
support tiered compilation. I did just realize that we currently only
apply tiered compilation to Leiningen's own JVM and not the project's,
so thanks for bringing that up; this will be rectified in preview4.

Thinking this over, I had another idea for a way in which launch could
be sped up using the trampoline task. Not sure if it's feasible, but I
will investigate it for the preview5 release:
https://github.com/technomancy/leiningen/issues/573

-Phil

-- 
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

Reply via email to