This is the mail archive of the java@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: 4.0.0 JNI/reflection invocation 2/4/8 times as slow as in 3.3.3


On Tue, 2005-01-25 at 21:21, Tom Tromey wrote:

> That's interesting.  Could you write a patch that includes an
> explanation of what is going on internally?  And ideally do some
> profiling so we can see the result?

Please excuse the delay.  A preliminary patch is attached.

Compared with 4.0 this is now ~800 times faster, but unfortunately not
as fast as 3.3.3 (times in ms):

sh-2.05b$ sh run.sh "3.3.3 4.0 4.0.new" 4000
3.3.3: 5 7
4.0: 5383 5459
4.0.new: 7 8

sh-2.05b$ sh run.sh "3.3.3 4.0.new" 400000
3.3.3: 826 894
4.0.new: 1110 1265

I suspect that it's due to the new getHashCode() function.  If we can
guarantee that the System.identityHashCode implementation never changes,
we can take advantage of the fact that it returns values which are
aligned at word boundaries.

The test I've used is also attached.


Jost


Attachment: gcc4-broken-identityhash.patch
Description: Text document

Attachment: IdentityHashMap.test.tar.bz2
Description: application/bzip


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