6 ms·
I'm not a Java guy, but I'm still wondering why nobody every wrote a JVM with near-zero startup time.
by amelius 9y ago
I'm not a Java guy, but I'm still wondering why nobody every wrote a JVM with near-zero startup time.
- lucian1900 9y agoIt's largely to do with standard library class loading. The only way to avoid this is an alternate compilation model, like GCJ (and other native code compilers) or Dalvik.
- pebers 9y agoPresumably it isn't easy to start everything the JVM needs & does in effectively no time. Although to be fair it actually is fairly quick for a "hello world" type program - much of the startup time of Java programs tends to be loading bytecode of their dependencies rather than starting the JVM itself.
- amelius 9y agoIsn't it possible to do lazy-loading in the JVM?
- chrisseaton 9y agoThe JVM does do lazy-loading.
- chrisseaton 9y agoIf you've got some good ideas of how to achieve this that you've been keeping to yourself then please share them!
- kybernetikos 9y agoA few years back I built a system that ran in the background and spun up fresh JVMs, which it then kept in readiness. When you wanted to start something, it would use the waiting one so you avoided the slowdown. Well, it was still pretty slow...
- ztjio 9y agoWell I am a Java guy and have two points to make. First. What are you even talking about? Quiet:test user$ time java Test Test real 0m0.104s user 0m0.074s sys 0m0.028s Quiet:test user$ That's on a current MBP 13" top end. And second: Who cares? What us "Java guys" do with Java, well, it doesn't matter in the slightest that it takes half a second to start. Because, we deploy to running processes. "We" power things like Hadoop clusters. The startup time is meaningless in "our realm" and frankly, I think if you're wondering about java for something like command line tools, it's just the wrong tool for the job for many reasons. And if you're looking at GUI apps, it's still better than Electron :P So seriously, Hacker News, what is the obsession with this?
- Swizec 9y ago> So seriously, Hacker News, what is the obsession with this? We are optimists, we think there is always something that could be improved.
- Insanity 9y agoIs that optimism or pessimism? ;-) "It's never good enough" can be interpreted in two way. Though I do agree that we should always strive to make it as good as possible. Being a "Java guy" myself, I indeed do not find the JVM startup time to be a big deal in our applications. Especially in my environment (hospital) where our program is pretty much running the entire day without a restart. So in the morning, the doctors/admin/.. start their application and rarely shut it down until the end of the day. (That is of course quite specific to where I work)
- imtringued 9y agoThe JVM languages usually add their own heavy libraries. I believe the JVM is optimized for loading the standard library as quickly as possible but this optimization doesn't apply if you use a JVM language that comes with it's own libraries.
- baxter001 9y ago> So seriously, Hacker News, what is the obsession with this? We are dilettantes, we think there is always something that could be improved in a domain we don't fully understand.
- pjmlp 9y agoBecause they already exist, people outside JVM world just aren't aware of them. https://www.excelsiorjet.com/ https://www.excelsiorjet.com/ is just one example from many third party commercial JDK vendors delivering AOT compilers since the early days of Java, and still in business. Also for those that don't want to pay for AOT compilers, OpenJDK is going to start supporting AOT compilation as well.
- cwyers 9y agoYou have to remember that the general bias on Hacker News is that if you have to pay for it, it doesn't exist.
- didymospl 9y agoAOT compilation and Project Jigsaw coming up in Java 9 should improve the JVM startup time. Although I guess it won't speed up the loading of applications written in other JVM languages much as it's not really JVM's fault.
- PopsiclePete 9y agoI don't run any client-side Java apps. But I do run quite a few server-side ones - like ES. Yes, startup time isn't lightning-fast, but once it's up - it's up for months. I can wait 15 seconds. Its cool.
- mike_hearn 9y agoThey did: https://youtu.be/5BMHIeMXTqA?t=12m5s https://youtu.be/5BMHIeMXTqA?t=12m5s