Native Acceleration

In order to improve the computation speed of image processing applications, the JAI comes with both Java code and native code for many platforms. If the JVM finds the native code, then that will be used. If the native code is not available, the Java code will be used. Thus, the JAI package is able to provide optimized implementations for different platforms that can take advantage of each platform's capabilities. You can find the difference between the native implementation and the Java implementation for a particular application by simply removing the native code libraries. For instance, on a Solaris SPARC platform, they will be located in the Java home directly under jre/lib/sparc. You will know you are using only the Java code when you see the following message: "Could not load mediaLib accelerator wrapper classes. Continuing in pure Java mode".

You will find that the time difference is highly dependent on your application. For the FloatViewer application in Listing 6.14, you won't see any difference. For the DFTTester application in Listing 6.12, you may see a 25 percent decrease in computation time.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset