[Kde-bindings] Using a custom RealProxy to implement a C# SMOKE adaptor

Richard Dale Richard_Dale at tipitina.demon.co.uk
Fri Aug 22 12:49:46 UTC 2003


On Friday 22 August 2003 12:08, Marco Ladermann wrote:
> Am Freitag, 22. August 2003 12:32 schrieb Richard Dale:
> > I've done a quick comparison of the overhead of a Proxy invocation vs.
> > JNI in Java, and the JNI call is about 10x faster. On an 800 MHz iBook,
> > this loop with 10 million method calls took 3.5s in JNI against 35s via
> > proxy calls:
> >
> > 		QFont myFont = new QFont();
> >
> > 		for (int count = 0; count < 5000000; count++) {
> > 			myFont.setPointSize(18);
> > 			QFont.removeSubstitution("Times Roman");
> > 		}
> >
> > So about 3 million method calls/s vs 0.3 million/s.
>
> Did you take into account that the reflection API was considerably improved
> in Java 1.4.x (see: http://java.sun.com/j2se/1.4.1/docs/guide/reflection/)?
> If your JVM version is 1.3 you might get better results with a more
> uptodate JVM.
I don't think Java 1.4.x is available for PowerPC Linux yet, so I can't 
upgrade. I've attached the test I ran, I'll cc this mail to the kdejava list, 
so other people can try it, and we can carry discussing there perhaps. I 
haven't compiled with gcj - that would be an interesting comparison.

Change the include directive in jni/makefile to point to your version, and 
compile, and it will build a library 'libtryit.so'. Ensure the current 
directory is on your LD_LIBRARY_PATH, javac the java sources, and run a 'time 
java Doit' command.

Compile the java sources in the proxy directory, and repeat the 'time java 
Doit' command.

-- Richard


-------------- next part --------------
A non-text attachment was scrubbed...
Name: jni_vs_proxy.tar.gz
Type: application/x-tgz
Size: 11914 bytes
Desc: not available
URL: <http://mail.kde.org/pipermail/kde-bindings/attachments/20030822/4fce2798/attachment.bin>


More information about the Kde-bindings mailing list