🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.jbuilder.java.language
Article #422

Re: Performance problems with jdk 1.5 on Linux plattform

#422
From: Shankar Unni
Date: Mon, 15 Aug 2005 21:14
20 lines
1774 bytes
Welf Wustlich wrote:

> public Vector<unit> units;

Using an arraylist helps slightly.

I got some fairly anomalous results comparing ArrayList and Vector: for 
the 1.5-style loops, ArrayList was faster then Vector, but for a loop 
with get() calls, Vector was faster. Vector was even faster than that 
using elementAt(), which was a surprise:

For a million summing iterations over a 100-element array:

vector elementAt loop took 3446 ms.
vector get loop took 3796 ms.
vector iterator loop took 5469 ms.
arraylist get loop took 4136 ms.
arraylist iterator loop took 4668 ms.

Really odd, and educational.
Technical Details
Message-ID: <430105bd$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail
References: <43009c82$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: f74b3,72d7453c0f169830
X-Google-Attributes: gidf74b3,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Mon, 15 Aug 2005 14:14:43 -0700
From: Shankar Unni <shankarunni@netscape.net>
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.7.10) Gecko/20050716 Thunderbird/1.0.6 Mnenhy/0.7
X-Accept-Language: en-us, en
MIME-Version: 1.0
Newsgroups: borland.public.jbuilder.java.language
Subject: Re: Performance problems with jdk 1.5 on Linux plattform
References: <43009c82$1@newsgroups.borland.com>
In-Reply-To: <43009c82$1@newsgroups.borland.com>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 68.120.146.125
Message-ID: <430105bd$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1124140477 68.120.146.125 (15 Aug 2005 14:14:37 -0700)
Lines: 20
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!border1.nntp.dca.giganews.com!border2.nntp.dca.giganews.com!nntp.giganews.com!pd7cy2so!shaw.ca!news-out.newsgroups.com!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail