Web Hosting Java, JSP, Tomcat 6, J2EE, Servlets, Struts, Jboss
Chapter 8. JNI You cannot dedicate a book
October 31, 2006 on 11:06 pm | In Java | Chapter 8. JNI You cannot dedicate a book to Java performance without addressing the issue of Java Native Interface (JNI.) After all, JNI is perceived by many to be the performance silver bullet when all else fails. Imagine working on a performance-challenged Java code, trying all the ideas set forth in earlier chapters and still falling short in achieving efficiency. You may be tempted, in desperation, to turn to JNI as a last resort. There are actually three popular scenarios for the use of native methods: . You may have a complex, pre-existing software written in C/C++ and the conversion of this code to Java is not a practical option for some reason. You can hook this software into your Java code via JNI. In this case, JNI bails you out of a costly porting effort. . You may need computational results that are simply not available in the Java environment and that necessitate the use of a system call. There are many such examples in the JDK that you may not be aware of. For example, System.currentTimeMillis() retrieves a timestamp from the underlying physical machine. . You may want to speed up a slow computation, and you think JNI will help you via C/C++ execution. In this chapter we will discuss the last (third) item only, as it is rooted in performance considerations that are up for debate. There’s a popular misperception that JNI is always a performance winner. The reality is not that simple. Page 176
Note: If you are looking for cheap and inexpensive provider to host and run your tomcat application check Actions tomcat hosting services
No Comments yet
Sorry, the comment form is closed at this time.
...I
just wanted to take the time to say "Thank you!" for our new webmail
system. It's great! Thanks for taking such good care of us.
Thanks
for helping me out. Just for the record, Webhostingjava.net has been a great
web host! So far your support and handling of questions has far
exceeded that of a "larger web hosting company".
I
would like to thank you for helping me with my domain...You have
shown me great patience and professionalism. I would not hesitate to
recommend you to my clients.