Live data from Hacker News

The JVM is not that heavy

opensourcery.co.za

61–70 of 373 posts

Re: The JVM is not that heavy

#61
Well, I sure wish I knew how to make our Clojure dev server (`lein ring server`) take less than 2 minutes to start up on a 4 core i7 16GB MacBook Pro.

Fortunately I typically only need to restart it when switching branches.

Re: The JVM is not that heavy

#62
post #13

I agree with many points in this article. That being said, there are dimensions of heaviness not captured in the article as far as I can see: 1. The startup times, not so much of the JVM itself, that just takes 1,5 secs, but the startup time of your application gets higher if you have a lot of classes on the classpath. I guess it's the classpath scanning that takes a lot of time (?). 2. Memory usage of Java objects i…

> 1. The startup times, not so much of the JVM itself, that just takes 1,5 secs

Where do you get these numbers from? On my five year old MacBook Pro with default JVM options parsing a 20 MB file:

real 0m0.248s

user 0m0.325s

sys 0m0.043s

> 2. Memory usage of Java objects is quite heavy.

That's IBMs enterprise VM that uses three word headers. HotSpot is actually better. If you compare that with other "lightweight" programming languages it is really, really light.

Re: The JVM is not that heavy

#63
post #34

i think most people wouldn't say the jvm is heavy compared to ruby or python runtimes, but rather golang , rust or swift. Aka : 1 file copy deployment, almost no boot time and 0 memory bloat. the first time i ran a server in go and realized it took a few kilobytes in ram when nothing happened, i was quite in shock.

1 file is the stupidest argument I've ever heard for saying one language is better than another.

Look, here's the 1 file it takes to install a python app I wrote: mycoolapp-0.1.0-1.el7.rpm - how neat is that?!

Sure, pretty much anything is "heavy" compared to go or rust, but those are systems programming languages by design, not something I'd write some huge web application in personally.

Re: The JVM is not that heavy

#64
post #40

It's not the JVM, it's the tooling.

Which tooling specifically? Going from Java to Python a couple years ago I was in shock about how immature the tooling in the Python world is by comparison.

Good question, I still haven't found something that trades blows with maven in any other programming language. I've made my peace with setuptools for python, but .Net/Ruby/Go/Rust/etc. are all lacking in one way or another.

Re: The JVM is not that heavy

#65
post #13

I agree with many points in this article. That being said, there are dimensions of heaviness not captured in the article as far as I can see: 1. The startup times, not so much of the JVM itself, that just takes 1,5 secs, but the startup time of your application gets higher if you have a lot of classes on the classpath. I guess it's the classpath scanning that takes a lot of time (?). 2. Memory usage of Java objects i…

In my mind, 1½ seconds is huge; that essentially rules out any interactive usage. It's even annoying for rapid development cycles. Only low expectations or heavy orchestration can overcome such a startling disadvantage.

That 1.5 seconds is FUD anyway.

Re: The JVM is not that heavy

#66
post #52

The notion that the JVM is not heavy because it needs less than a GB of disk space seems crazy to me. I consider OpenSSL to be wildly bloated because it is over 1 MB .

OpenSSL only does one thing.

Well, LibreSSL devs considered OpenSSL bloated from a security standpoint [1].

[1] - https://en.wikipedia.org/wiki/LibreSSL#Code_removal

Re: The JVM is not that heavy

#67
post #13

I agree with many points in this article. That being said, there are dimensions of heaviness not captured in the article as far as I can see: 1. The startup times, not so much of the JVM itself, that just takes 1,5 secs, but the startup time of your application gets higher if you have a lot of classes on the classpath. I guess it's the classpath scanning that takes a lot of time (?). 2. Memory usage of Java objects i…

Did you test that 1.5 second claim yourself? I literally just wrote a HelloWorld and ran it on my MacBook, the total time for the whole program was <0.2 seconds.

Re: The JVM is not that heavy

#68

I led our teams to switch from Java to Go because of the productivity of development, but then noticed deployment was simpler and faster, memory usage was slashed (for comparable applications), request/response times were much more consistent, startup was practically instant and as a result we started aggressively rewriting Java applications to Go and saw a notable difference in the number of machines we needed to ru…

I don't know why you are getting downvoted for sharing your real world experience, lately "fanboyism" on HN is getting out of hand. I have similar experience with one of the services that was ported from Java to Go.

Re: The JVM is not that heavy

#69
Ruby is perl-minded folks reinventing python without understanding it. The result was: ruby is python-done wrong.

Now comparing python flask uwsgi and jvm jetty apps are in favor of python in all metric.

Starting a django elephant takes no time compare that to starting less capable framework of choice in java world.

To be fair, java can be much much faster than python. But usually you don't care because python is not the bottleneck. Ex. The bottleneck can be in the SQL query

Re: The JVM is not that heavy

#70
post #58

The notion that the JVM is not heavy because it needs less than a GB of disk space seems crazy to me. I consider OpenSSL to be wildly bloated because it is over 1 MB .

A megabyte of disk space is now worth about $0.0000290, according to this site: http://www.jcmit.com/diskprice.htm The numbers we're talking about here just aren't a practical consideration any more.

The disk space is cheap, sure.

But the CPU time spent by the dynamic linker resolving thousands upon thousands of symbols? That's actually rather painful.

Post reply on HN