Announcing J2V8 3.1

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.

2 Comments
  • mike
    Reply
    Posted at 10:49 pm, December 22, 2015

    Hello,

    I am trying to compile the j2v8 to android with android studio.
    I did the following:
    1. libs/j2v8-3.1.6.aar
    2. build.gradle:
    repositories{
    flatDir{
    dirs ‘libs’
    }
    }
    dependencies {
    compile ‘com.eclipsesource.j2v8:j2v8:3.1.6@aar’
    }
    And got an error:
    Error:Execution failed for task ‘:app:transformClassesWithDexForDebug’.
    > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process ‘command ‘C:Program FilesJavajdk1.8.0_60binjava.exe” finished with non-zero exit value 2

    Please help me,
    Thanks,
    Mike

Post a Comment

Comment
Name
Email
Website