Performance issues related to trigonometric functions , floating point arithmetic and JNI (II)
5 February 2008This post is in continuation of trigonometric functions , floating point arithmetic and JNI (I).
Java Native Interface
Using JNI has its advantages but not without some overheads associated with it.
- JNI can be invoked by only applications and signed applets.
- An application that uses JNI loses the platform portability the Java boasts. To get way with it is to write a separate implementation of the JNI code for each platform and have Java detect the Operating System and load the correct one at runtime.
- Garbage collection for the JNI side is not available and JNI code must do the explicit or manual deallocation as in other programming languages.
- Error checking is a mandatory or it has the potential danger to crash the JNI side and the JVM.
However, it must be said that these overheads can be overlooked for what JNI has to offer.
Related Posts:
- Performance issues related to trigonometric functions , floating point arithmetic and JNI (I)
- Java IO tasks
- Java built-in data types (performance issues)
- Vector Capacity
- Performance Issues (adding element to a Vector)
- Performance Issues (String Concatenation)
- Benefits of using Final class
- Java performance Issues (I)
- Performance Issues (StringTokenizer)
- Java performance Issues (III) - Garbage collection
Top Of Page | Trackback
If you found this page useful, consider linking to it. Simply copy and paste the code below into your web site.
It will look like this: Performance issues related to trigonometric functions , floating point arithmetic and JNI (II)