Jnioverhead is a project mainly written in C and PYTHON, based on the GPL-2.0 license.
Code to test the raw overhead of a JNI call, as opposed to calling the method from C
README for JNI Overhead Tester Written by Aaron Lindsay [email protected], February 10, 2011
Copyright (C) 2011 by Aaron Lindsay Redistribution of this file is permitted under the GNU Public License.
The purpose of this test is to find the overhead of making a call to JNI versus making a native call to the same function in C.
Follow these steps to build and run the test:
Ensure that you have the following installed
Build the tests
a. If you are using a JDK different from OpenJDK, update the line in the Makefile that currently says the following to point to the directory which contains the JNI header (jni.h) on your operating system.
JNI_INCLUDE_DIR=/usr/lib/jvm/java-6-openjdk/include
b. Build them using GNU make. The following command will suffice:
$ make
Run the tests
Simply run (sudo is required, because the Makefile uses the 'nice' command, which requires root privileges):
$ sudo make run
Written by Aaron Lindsay [email protected], February 10, 2011