[cp-patches] FYI: speedup Cairo graphics stuff

Roman Kennke roman at kennke.org
Sun Jun 11 19:01:15 UTC 2006


Hi Tom,

Am Sonntag, den 11.06.2006, 11:10 -0600 schrieb Tom Tromey:
> >>>>> "Roman" == Roman Kennke <roman at kennke.org> writes:
> 
> Roman> I speeded up the Cairo graphics impl significantly by changing
> Roman> the way the native pointers are managed between Java and JNI
> Roman> code. Until now, we used to lookup the class+fields of the
> Roman> native pointers and fetched the value from the passed in
> Roman> jobject. I changed this so that the pointer is passed to the
> Roman> JNI code directly as long. This avoids the overly costly
> Roman> lookups. The speedup is impressive, where the FillRect demo
> Roman> needed ~250ms for one frame, it now dropped to ~130ms.
> 
> I think this is an interesting discovery.
> Maybe we ought to mention it in the hacking guide?

Yeah. And maybe we should grep through the sources and find other
occasions of such lookup code. It especially hurts for JNI methods that
are called often and/or have short execution time. I think I saw some of
these in the net code...

/Roman

-- 
“Improvement makes straight roads, but the crooked roads, without
Improvement, are roads of Genius.” - William Blake
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Dies ist ein digital signierter Nachrichtenteil
Url : http://developer.classpath.org/pipermail/classpath-patches/attachments/20060611/0422d85e/attachment.pgp


More information about the Classpath-patches mailing list