This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: libffi vs. SPARC (again)


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.



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]