On Thu, Mar 28, 2013 at 9:26 PM, Mikera <mike.r.anderson...@gmail.com> wrote: > On Friday, 29 March 2013 05:45:53 UTC+8, Laurent PETIT wrote: >> >> 2013/3/28 Marko Topolnik <marko.t...@gmail.com>: >> > Or you may have just a trivial requirement for a program that both >> > starts >> > and executes quickly. >> >> To what extent would an LLVM / C version of a Clojure program not >> incur startup penalty as the JVM does. >> >> As far as I understand it, the startup cost is manyfold: >> 1/ JVM startup >> 2/ loading of Clojure Core >> 3/ loading of non-lazy parts of your application (generally from >> loading a global namespace to invoke its -main function) > > In my experience 1) is a small fraction of the total. A trivial "hello > world" Java program runs in less than 0.1sec on my machine, which proves > that JVM startup isn't really important. Or at least, far less important > than most people think.
I certainly don't see that. I've measured this more than a few times, and it's several seconds for a simple "Hello World" Java application on any machine that I can touch. Additionally, on an embedded system, I'm not going to have the same kind of CPU power. For instance, the current processor we use runs at 400MHz instead of your desktop's 3GHz. [snip] > It might even be slower in LLVM / C, unless you can at least match the JVM > in terms of JIT optimisation and garbage collector efficiency, which in turn > affects the runtime for 2+3 (I believe a garbage collector is a requirement > to execute Clojure?). Beating the JVM isn't an easy feat. You could argue the same for any application written in C, though I think in practice C keeps up pretty well. However, raw execution speed isn't necessarily my goal. More interesting to me is having better tools to use. Clojure's approach to concurrent programming is world's better that the "share everything" approach used in C, and it's that facility that I'd like to use the most. But requiring the JVM to use it--in my environment--is just too high of a price to pay. To be honest, LLVM might be too high as well. LLVM is certainly far from small and lightweight. :-) -John -- -- 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/groups/opt_out.