Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > JNI wrapper class

Reply
Thread Tools

JNI wrapper class

 
 
Jim
Guest
Posts: n/a
 
      09-11-2005
Am writing a JNI wrapper class.
Are there any performance advantages of the JNI C routine calling a Java
method to set some variables all at once, or using SetIntField,
SetByteField, etc, to set the variables?

Which is normally recommended? Much less code to just call the method.

Thanks,


 
Reply With Quote
 
 
 
 
Roedy Green
Guest
Posts: n/a
 
      09-12-2005
On Sun, 11 Sep 2005 18:06:41 -0400, "Jim"
<> wrote or quoted :

>Which is normally recommended? Much less code to just call the method.


the fewer the number of JNI calls the faster the code will be.
--
Canadian Mind Products, Roedy Green.
http://mindprod.com Again taking new Java programming contracts.
 
Reply With Quote
 
 
 
 
Stefan Schulz
Guest
Posts: n/a
 
      09-12-2005
On Mon, 12 Sep 2005 03:38:29 +0000, Roedy Green wrote:

> On Sun, 11 Sep 2005 18:06:41 -0400, "Jim"
> <> wrote or quoted :
>
>>Which is normally recommended? Much less code to just call the method.

>
> the fewer the number of JNI calls the faster the code will be.


That is right. However, the more atomic the native call, the less time is
spend in the most tedious and complicated debugging process i know
(ideally, none).

I am all for speed, but when it comes to JNI, i usually wrap as tightly as
i can, often creating a (private, static) method per native function.

--
You can't run away forever,
But there's nothing wrong with getting a good head start.
--- Jim Steinman, "Rock and Roll Dreams Come Through"


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
JNI C++ Wrapper Philipp Kraus Java 1 10-10-2011 09:54 PM
Trouble with JNI wrapper functions Colby Nyce Java 1 09-08-2011 07:35 PM
WebSphere JVM Access Violation Problem running Java program that calls methods in a Windows C++ DLL via a JNI wrapper....... adgarcia13 Java 2 06-28-2006 11:19 AM
including package name in jni wrapper Rob Java 2 06-14-2004 03:55 PM
IBM's JNI fails where Sun's JNI works Alex Hunsley Java 4 11-04-2003 10:34 AM



Advertisments