3 ms·
Well 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 0
by ztjio 9y ago
Well 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.
- xchaotic 9y agoThe obsessions are because you can have serverless architecture and spin up things on demand. If you Need to load a ton of things that kills performance and latencies add up.
- dkersten 9y agoThe obsession with this is that people would like to be able to use their favourite JVM language to write CLI tools, consumer-GUI tools or AWS lambda programs. Sure, you can just say that the JVM is the wrong tool, but that is a somewhat unsatisfying answer because it still doesn't let me write those things in clojure/scala or whatever JVM language.
- pjmlp 9y agoThey can, it is their problem if they keep ignoring the existing AOT compilers, and there are quite a few.
- kasey_junk 9y agoAre there any without an expensive license?
- pjmlp 9y agoOpenJDK 9 if on Linux x64, but it is still not yet released. ExcelsiorJET has a free license for non-commercial uses. https://www.excelsiorjet.com/ https://www.excelsiorjet.com/ https://www.excelsiorjet.com/#free https://www.excelsiorjet.com/#free RoboVM's fork is another possibility https://github.com/MobiVM/robovm https://github.com/MobiVM/robovm
- btym 9y ago>it still doesn't let me write those things in clojure/scala If you're writing Scala, you have the option of compiling with scala-native, which targets LLVM. http://www.scala-native.org/en/latest/ http://www.scala-native.org/en/latest/
- KirinDave 9y agoBecause it's an axis of numerical optimization that can be carried out of context anywhere, freely ignored or harped upon at will. See also: "your _____ takes too much memory." "Your ____ takes more computational resources than _____." E.g., The new existential threat for the entire programming world is Atom/VSCode and other Electron apps. In short, it's people without a point hoping to discredit something for various reasons.
- nurettin 9y agoI'd imagine most people here are just web developers and haven't used anything beside nodejs in a professional environment, so their first reaction to java is "oh, I have to restart the server everytime I change a web page? that's a pain". Not saying it can't be done with java. Even android studio has a hot class swapping feature (I know it isn't JVM but as a proof of concept this exists)
- pjmlp 9y agoThere is no need to restart the server all the time, it depends on the type of change. When using plain JSPs with exploded WARs, you can usually hot reload.
- shock 9y agoThe JVM supports hot swapping. There's also DCEVM⁰, which supports more features than OpenJDK Hotspot. ⓪ - https://github.com/dcevm/dcevm https://github.com/dcevm/dcevm
- rbehrends 9y agoThis is for an empty program. Serious Java programs (especially those that pull in a lot of libraries) can easily take >1s to start up. Running jruby on an empty file takes 1.4s wall clock time and nearly 4s of CPU time for me. Time to compile a hello-world program with Kotlin is 1.9s wall clock time and over 4s CPU time. It's worse with Scala. If I want to write code that (say) is run dozens of times during a large build process, that's not really acceptable. The JVM is a poor fit for the Unix model in particular, which tend to use lots of small processes with a single purpose that work together. Yes, there are workarounds (been there, done that), but the larger point is that the JVM and its ecosystem are primarily targeted at fairly heavy-weight and long-lived server processes that have obvious implementation biases along these lines. The slow startup time is just one symptom of these implementation biases, and the question is not whether you can work around these problems, but why you should bother in the first place if the JVM is a poor fit for your application domain.
- riku_iki 9y ago> Serious Java programs (especially those that pull in a lot of libraries) So, which language allows serious programs do a lot of work without time penalty?..