🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.jbuilder.java.language
2 messages
2 total messages Started by Welf Wustlich Mon, 15 Aug 2005 13:51
Performance problems with jdk 1.5 on Linux plattform
#421
Author: Welf Wustlich
Date: Mon, 15 Aug 2005 13:51
21 lines
1547 bytes
Performance problems with jdk 1.5 on Linux plattform
(not tested on Windows, might be the same)

After refactoring using the new features from java 1.5 I lost
performance significantly:


public Vector<unit> units;

The new code:
         for (unit u: units) u.accumulate();

runs more than 30% slower than the old code:
         for (int i = 0; i < units.size(); i++) 
units.elementAt(i).accumulate();

I expected the opposite.
Is there any information available that helps?


Best regards, Welf
Re: Performance problems with jdk 1.5 on Linux plattform
#423
Author: Jeroen Wenting
Date: Tue, 16 Aug 2005 11:41
13 lines
1511 bytes
>After refactoring using the new features from java 1.5 I lost
>performance significantly:
>
compiler performance or runtime?
The compiler needs to do more work so is probably a tad slower, runtime performance overall is improved.

>
>public Vector<unit> units;
>
do you NEED Vector?
ArrayList does the same and is a LOT faster, and has been since 1.3.
Possibly the code for Vector (which is kept mainly for backwards compatibility, I've never understood why they don't just deprecate the entire class) didn't receive the optimisation the rest did.
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads