[vwnc] [ANN] JNIPort 1.6 - faster than ever

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[vwnc] [ANN] JNIPort 1.6 - faster than ever

Joachim Geidel
JNIPort 1.6 is now available from the Cincom Public Store Repository and
from
    http://jniport.wikispaces.com

JNIPort is a Smalltalk library which allows Java code to be invoked from
Smalltalk. It acts as a bridge between the world of Smalltalk objects
and a Java Virtual Machine where Java code is executing.

Johan Brichau's comparison of JavaConnect and JNIPort showed that looking up
wrappers for Java classes was slower in JNIPort 1.5 than in JavaConnect
2.0-beta. An investigation showed that the main reason was this single piece
of code in JNIPort's JavaClassIndex:

  symbol := aClassName asSymbol.
  sharedMutex critical: [index at: symbol ifPresent: [:it | ^ it]].

The non-local return from the critical block was not good, at least when
running a test which executes it a million times in a row. Changing it to

  symbol := aClassName asSymbol.
  classStatic := sharedMutex critical: [index at: symbol ifAbsent: [nil]].
  classStatic notNil ifTrue: [^classStatic].

made a real difference. I have changed a few more methods, and now JNIPort
compares favorably to JavaConnect again. The results are online at
    http://jniport.wikispaces.com/Performance+Comparison

Please don't overrate those numbers. Microbenchmarks won't tell you much
about the performance of a real application, and the code snippets which
have been measured are far from representing the behaviour of a real-world
application.

Claus Kick has asked for a comparison between JNIPort and JavaConnect on
this list, and Johan has described some of the differences on the
JavaConnect web site. I have written down my own view of the differences
here:
    http://jniport.wikispaces.com/Comparing+JNIPort+to+JavaConnect

Best regards,
Joachim Geidel


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc