On Fri, Mar 29, 2013 at 5:49 AM, Mikera <mike.r.anderson...@gmail.com> wrote: > I decided to benchmark JVM startup again, in case of any doubt, and because > I see plenty of FUD on this issue.
Sorry, I don't mean to spread any FUD. I'm just being loose with the phrase "start-up time". You're right, I should be more precise in my terminology. FWIW, I think when people talk about this, they're doing the same thing: including the class loading overhead for something other than the most trivial of examples. [snip] > As you can see JVM startup is 0.1s or less: in fact the entire execution of > Hello World took 0.1 sec on my machine. Note that this is the server VM. I > did about 20 successive runs which were all in the 0.08 to 0.12 sec range. Yes. It's about double that on my machine, but within reach. [snip] >> 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. > > I suggest you recheck your measurement approach / configuration. See above > :-) Okay. I pushed up a barebones example of a command line application here: https://github.com/jszakmeister/barebones Really, it's just Clojure plus tools.cli, and a small snippet in main. Running this 10 times, I'm seeing about 3.07s on my machine to execute this example. I built in with "lein2 uberjar", and did: :: time java -jar target/barebones-0.1.0-SNAPSHOT-standalone.jar {:faux bar, :help false} Hello, World! java -jar target/barebones-0.1.0-SNAPSHOT-standalone.jar 3.09s user 0.28s system 186% cpu 1.804 total :: java -version java version "1.6.0_43" Java(TM) SE Runtime Environment (build 1.6.0_43-b01-447-10M4203) Java HotSpot(TM) 64-Bit Server VM (build 20.14-b01-447, mixed mode) > Agreed that any embedded processor is likely much slower than a PC (mine is > a laptop in fact). And IO speed probably makes a big difference as well if > there are caching effects / large .jar files to load. Definitely. [snip] > Agreed - the JVM is a poor fit for very tightly constrained environments. > Excited to see what you can achieve here! > > Just don't knock the JVM unfairly, it is one of the best tools we have :-) I don't mean to do that. The JVM is an amazing piece of software. I just happen to be in circles where folks believe it's the answer to everything, and unfortunately, it's not. It has some limitations and it isn't well-suited to every problem. Even at 100ms for the start-up time, that's still pretty non-trivial for a command line application. The real question is whether we can get something like the barebones example to fire up and run in a similar amount of time. As you said: I'm excited to see what can be achieved in this space! -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.