This is the mail archive of the
java-patches@sources.redhat.com
mailing list for the Java project.
Re: Speed up array allocation
- To: Jeff Sturm <jsturm at detroit dot appnet dot com>
- Subject: Re: Speed up array allocation
- From: Bryce McKinlay <bryce at albatross dot co dot nz>
- Date: Sat, 06 Jan 2001 17:50:20 +1300
- CC: Tom Tromey <tromey at redhat dot com>, java-patches at sources dot redhat dot com
- References: <Pine.LNX.4.21.0101051727460.6877-100000@cc42593-a.taylor1.mi.home.com>
Jeff Sturm wrote:
> On 5 Jan 2001, Tom Tromey wrote:
> > Another choice would be to force every array to have the same
> > alignment. I didn't want to do that since it wastes space.
>
> Really? If you require all arrays to have double alignment, I figure you
> waste at most 4 bytes per array (on x86). Is that really significant to
> some apps? I personally would prefer the simplicity of uniform
> array alignment.
Once we get rid of sync_info the alignment will always be perfect on x86 (at
8 bytes). On a 64-bit ABI we'd waste 4 bytes per array where sizeof
(elementtype) <= 4. Probibly this is fairly insignificant in the 64-bit
context.
I'd agree that for speed and simplicity it would be desirable to do this, if
nobody comes up with a better solution. Presumably it would require changes
to the compiler though?
regards
[ bryce ]