x
Loading
 Loading
Join 10,000+ Fans Join 5,000+ Followers Join 1,000+ Members Join 10,000+ Subscribers Subscribe to Daily Updates
Follow Linux Magazine
Hello, Guest | Login | Register

Going Native

Java is great for solving many kinds of problems, but it isn’t the first programming language that comes to mind when application performance is a critical issue. Sure, you can try to work around this with more powerful hardware, but at some point, a program written in Java just isn’t going to run any faster.

Java is great for solving many kinds of problems, but it isn’t the first programming language that comes to mind when application performance is a critical issue. Sure, you can try to work around this with more powerful hardware, but at some point, a program written in Java just isn’t going to run any faster.

One way to speed things up is to recode parts of your application into C, C++, or even assembly language and then call these functions via JNI, the Java Native Interface (http://java.sun.com/j2se/1.3/docs/guide/jni). However, this would take costly development time and would jeopardize the portability that is Java’s hallmark.

In a way, the design of Java itself works against you. The Java compiler javac does not generate truly native instructions like gcc and g++ do for C and C++. Instead, the Java compiler generates bytecodes, which must then be converted into native…

Please log in to view this content.

Not Yet a Member?

Register with LinuxMagazine.com and get free access to the entire archive, including:

  • Hands-on Content
  • White Papers
  • Community Features
  • And more.
Already a Member?
Log in!
Username

Password

Remember me

Forgotten your password?
Forgotten your username?
Read More
  1. The Party of Gno
  2. Intro to CUDA
  3. Helpful Tools for Software Developers
  4. The Github Hall of Fame
  5. Book'em, Github.