This is the mail archive of the
java-patches@gcc.gnu.org
mailing list for the Java project.
Re: PATCH: libffi vs. SPARC (again)
- To: Jeff Sturm <jsturm at one-point dot com>
- Subject: Re: PATCH: libffi vs. SPARC (again)
- From: Bryce McKinlay <bryce at waitaki dot otago dot ac dot nz>
- Date: Wed, 14 Nov 2001 21:55:36 +1300
- Cc: java-patches at gcc dot gnu dot org
- References: <Pine.LNX.4.10.10111140345290.8053-100000@mars.deadcafe.org>
Jeff Sturm wrote:
>I'm a little concerned with the extent of data copying taking place. A
>typical call to Method.invoke() will copy its arguments twice: once in
>_Jv_CallAnyMethodA, and again in ffi_prep_args. My application is very
>demanding on reflection; this needs to be fast. I don't see how it can
>improve much given the current libffi API. I may investigate using the
>raw API here; though it is skewed for stack architectures (x86) it might
>be of some value.
>
One thing that could be done, I think, in Method.invoke() is to cache
the ffi's cif structure in the Method objects? Although its stack
allocated, calling ffi_prep_cif every time looks pretty expensive.
Last time I checked, we did pretty good compared to the JDK at
reflection, but I've heard that the JDK has sped it up a lot in recent
releases.
I'd also like to have sorted method names in classes in order to speed
up the method name searches. This will help with things like the itable
layout and also something else I'm working on. Maybe we can look at that
in conjunction with compressed class metadata.
regards
Bryce.