Imagine a bacon-wrapped Ferrari. Still not better than our free technical reports.
See all our reports

10 Reasons Why Java Rocks More Than Ever: Part 5 – High-Performance JVM

geert-conference

Well, the conference season is over as far as I’m concerned! I’m still waking up in the middle of the night to put the final touches on tomorrow’s talk, only the realize when stepping in the shower that I have no talks planned for the foreseeable future! So, it’s back to coding and writing, here with the fifth episode of my ‘Java Rocks’ series.

As a reminder, here are my top 10 favorite things about the Java platform again:

  1. The Java Compiler
  2. The Core API
  3. Open-Source
  4. The Java Memory Model
  5. High-Performance JVM
  6. Bytecode
  7. Intelligent IDEs
  8. Profiling Tools
  9. Backwards Compatibility
  10. Maturity With Innovation

This time I’ll talk in more detail about 5. High-Performance JVM

What rocks about the Java virtual machine (JVM)?

That’s an easy one, isn’t it? Most people will tell you that the differentiator of Java is its cross-platform nature. Java offers write-once-run-anywhere, which is provided by the virtual machine. That’s not very unique though, a lot of languages and platforms have adopted virtual machines and Java wasn’t even the first. Smalltalk relied on a virtual machine a decade before Java was even invented!

So, what rocks about the Java virtual machine? In short, by now it’s the virtual machine. The JVM is the most complete of any application VM out there: it’s cross-platform, open-source, crazy fast, verifies the bytecode for safety, hosts both statically and dynamically typed languages, provides automatic memory management and it’s tunable at runtime.

Why does this matter for us developers?

During those years in which I was mostly writing C++ code, I couldn’t believe how much complexity came with writing software for physical machines. We had to make sure that we properly tested and compiled for all the target architectures, and it was also quite annoying to actually create the software. Developers had to be versed in the different versions of the major operating systems and we had to ensure that our development environments could actually co-exist. This made fundamental things like build tools exponentially more complex.

The CPython development process during those years suffered from the lack of maturity of the Python Virtual Machine. It’s nowhere near as optimized as the JVM and is hampered by the dreadful ‘global interpreter lock‘ that makes parallelism really hard to handle. So we had to constantly off-load performance critical code to native code and pay the price for non-VM development, even though we were using a VM.

The JVM is so fast that you get the best of both worlds as long as you don’t require real-time operations, which is the case for most applications out there. So, thanks to having such high performance, Java developers can really leverage the goodness of Virtual Machine-based development in all its glory.

What does the future hold for the JVM?

The Internet of Things is all the rage these days and we’re going to see an exponential range of different devices appear on the market, each changing at an even faster pace than before.

It’s going to be nearly impossible to know the ins and outs of each individual hardware architecture. However, you will want your application to run on most devices to leverage the connectivity features of constant ubiquitous access to your software. So, a high-performance virtual machine is becoming more relevant than ever.

geert-embeddedpanel

With Java 8, Oracle is pushing out a new version of Java SE that specifically targets smaller devices like the Raspberry Pi, the BeagleBone and others.

Java embedded development used to be a completely different platform with the JavaME edition. It was almost impossible to hone your development skills from the standard or the enterprise edition. With Java SE Embedded, all the Java 8 language features are there. The JVM has been shrunk down and optimized for each embedded platform and the API features are well-defined subsets of the full-blown standard edition. Through three profiles, you’re able to select exactly which features you need to keep the footprint down, all the time while continuing to use the same knowledge and tools that are available for desktop or enterprise development. The Java Embedded Suite even provides you with an optimized application server, service layer and database, so it’s extremely easy to create a RESTful web application that communicates with other devices.

Embedded devices and IoT fun

At ZeroTurnaround we’re always up for a good hackfest and that’s exactly what we did at Devoxx! By co-hosting a two-day workshop, we explored the possibilities of Java SE Embedded on a wide range of devices through the Embedded Devices Panel that was put together by Yara and Vinicius Senger. In the end, my personal hack revived our iconic rainbows and remotely controlled them through hand-gestures!

Regardless of what your interests or needs may be, you can rest assured that the JVM will be able to perform at the level required for your applications–from high-throughput web apps to setting up a Raspberry Pi with Java SE Embedded for powering that beer chauffer / kitty-box cleaning robot.

Do you have any experience with Java and IoT? Any fun projects you would like to share? Please leave comments below, or tweet @gbevin or @RebelLabs. :-)

  • http://qlambda.com/ kadaj

    Also there are JVMs that implement RTJS which provides hard real time guarantees.

  • 370

    Joke