Announcing J2V8 3.1

December 10, 2015 | 2 min Read

Just in time for Christmas, J2V8 3.1 is now available. It ships as standard JAR from Maven Central, an Android Archive (AAR) for your Android developer friends, and now as an OSGi bundle. Here is the official New and Noteworthy for J2V8 3.1.

Note: Please consume 3.1.6. I had a number of deployment issues when pushing out 3.1.0 and it took me a few tries.

Performance Improvements

J2V8 3.1 brings a number of performance improvements. Most notably, we have completely re-implemented how C++ objects are mapped to Java Objects. Instead of using a map, we now directly reference the C++ objects by their memory address. This should improve the lookup time for each V8Object.

The lookup of JNI MethodIDs has also been changed. Instead of looking them up on demand, they are all precomputed when J2V8 starts. This should improve the runtime performance of the library.

Fixed Memory Leaks

Whenever a Java method was registered as a callback, a Method Descriptor was allocated. This descriptor was never released, causing a slow memory leak as more and more callbacks were registered. Now, when a V8 Runtime is released, all the method descriptors associated with that runtime are deleted.

Cleaned up API

There was a small typo in our API. The old method is deprecated and new API added.

Formats

J2V8 is now available in a number of different formats. To make J2V8 easier to consume on Android, J2V8 can now be consumed as an Android Archive (AAR). Also, for my OSGi / Eclipse friends, J2V8 now ships as an OSGi bundle packaged in a p2 repository. J2V8 can be consumed using a Maven or Gradle dependency.

For more J2V8 information, follow me on Twitter.

Ian Bull

Ian Bull

Ian is an Eclipse committer and EclipseSource Distinguished Engineer with a passion for developer productivity.

He leads the J2V8 project and has served on several …