This is the mail archive of the java-patches@sources.redhat.com 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]

Re: Speed up array allocation


>>>>> "Bryce" == Bryce McKinlay <bryce@albatross.co.nz> writes:

Bryce> One obvious performance sink which remains is
Bryce> _Jv_GetArrayElementFromElementType. It would be really nice if
Bryce> we could figure out a way to avoid this.

We don't need it in _Jv_NewObjectArray since there we know we are
always allocating an array of objects, and so the alignment will
always be the same.

Maybe we could store the alignment info in each primitive's Class.
Then we could replace the use in _Jv_NewPrimArray with a field lookup
on the Class.


Another choice would be to force every array to have the same
alignment.  I didn't want to do that since it wastes space.

We could add a new virtual function to __JArray.  That is harder than
it looks because we create the array vtables explicitly (in prims.cc)
and there isn't a good way to set the new slot correctly.

Tom

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