3 ms·
I wish someone would dissect JVM in exactly the same way: i.e. clearly explained what needs to be stripped off to have a quickly loading "hello world" implement
by old-gregg 17y ago
I wish someone would dissect JVM in exactly the same way: i.e. clearly explained what needs to be stripped off to have a quickly loading "hello world" implementation eating less than 1MB of RAM and starting in a few microseconds, like a normal, sane process should.
All these wonderful things are being built (Clojure, JRuby) on top of JVM that are of no use outside of web/EE because default JVM is so heavy.
Yes, a VM does a lot more than just bootstrapping your stdlib, like in case of libc, yet I keep thinking there must be plenty of unnecessary fat to strip off. Just look at Microsoft CLR: same feature set, yet none of that sluggish starting, RAM-wasting JVM nonsense.
- kevingadd 17y agoThis reminds me of a blog post from one of the Unity developers: We joke that doing anything in C# will result in an XML parser being included somewhere. This is not that far from the truth; e.g. calling float.ToString() will pull in whole internationalization system, which probably somewhere needs to read some global XML configuration file to figure out whether daylight savings time is active when Eastern European Brazilian Chinese calendar is used. http://aras-p.info/blog/2009/11/14/improving-cmono-for-games/ http://aras-p.info/blog/2009/11/14/improving-cmono-for-games... The sad thing is that he's not kidding - if you profile a typical application under Mono or .NET, it loads an XML parser almost immediately.
- vl 17y ago.NET policy configuration files are in XML. To parse them there is another internal XML parser in mscorlib (.NET runtime dll).
- InclinedPlane 17y agoI heard a joke once that anytime you run Javascript in a browser an XML parser is being included somewhere.
- judofyr 17y agoIt's not very well documented, but BiteScript looks very interesting: http://blog.headius.com/2009/03/bitescript-001-ruby-dsl-for-jvm.html http://blog.headius.com/2009/03/bitescript-001-ruby-dsl-for-... http://blog.headius.com/2009/05/bitescript-002-scripting-examples.html http://blog.headius.com/2009/05/bitescript-002-scripting-exa...
- Tuna-Fish 17y ago> Just look at Microsoft CLR: same feature set, yet none of that sluggish starting, RAM-wasting JVM nonsense. If anything, CLR is more bloated than the JVM, not less. The libraries it uses just are used at startup, so when you start an app they are already in memory. Note that I don't think that the bloatedness of JVM or CLR is a bad thing -- as long as you properly dynamically link, the cost of having them is quite minimal on modern hardware.
- bokchoi 17y agoThere are folks within Sun/Oracle doing exactly that. One effort, Project Jigsaw, is aimed at splitting the large rt.jar into smaller modules to reduce the number of classes loaded on startup. Here is an update from last December: http://blogs.sun.com/alanb/entry/is_the_jdk_losing_its http://blogs.sun.com/alanb/entry/is_the_jdk_losing_its Somewhere in there is a comment that says the JVM loads around 300 classes to run an empty main class. I'm curious to see what the merged HotSpot+JRockit JVM will look like in a few years.