Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!.POSTED!not-for-mail From: Jan Burse Newsgroups: comp.lang.java.programmer Subject: Re: Bulk Array Element Allocation, is it faster? Date: Sun, 25 Sep 2011 10:39:08 +0200 Organization: albasani.net Lines: 26 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15; format=flowed Content-Transfer-Encoding: 7bit X-Trace: news.albasani.net L+WkmeQ1EwnhsJi0e9Pr6rnrbFhpFjlnQGC5ShPbIzCedFHg8HLDrQkFdl1FXvE2z/rnx4CzLrQ4q6TEzgsg8tBojU4D1lb8eyW6WCeXYPKfd3nP/y6wr5hywwqCNltc NNTP-Posting-Date: Sun, 25 Sep 2011 08:39:08 +0000 (UTC) Injection-Info: news.albasani.net; logging-data="KFBVuoiSj2CD9Kky8a4vUksnW7hzDAxAVIAyJOKaOratSFfvLWzuCR6848O94QlkzgUjvpEz6TXroxClxYABLWrjBVp8mPfHhGSjm9tMnmNN8TRTIa4ysE4ZBZxIvFyt"; mail-complaints-to="abuse@albasani.net" User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.6; rv:6.0.2) Gecko/20110902 Firefox/6.0.2 SeaMonkey/2.3.3 In-Reply-To: Cancel-Lock: sha1:+FEwkaKfSjIo7rR7BcqpSM8JK4o= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8283 Eric Sosman schrieb: > This could be a win if you will actually use only a few of > the array elements, and if constructing a Bla is expensive (for > example, if it involves I/O). If Bla's are cheap to make, or if > you'll wind up using most of them anyhow, there's no obvious > reason to conditionalize. The bla does nothing. And yes it could be that a bla is not needed, that is why I invented the lazy scheme. But I see the slowdown especially for when all the bla's are needed. > Nine percent longer. But I'm highly suspicious of those nice, > round numbers: It seems an unlikely coincidence that two rather > different chunks of code should both execute in even tenths of > seconds. Repeated measurements give different figures, which lead me to see an accuracy of measurement of around 100ms, so instead of telling you that the application needs one time 9538 ms and another time 9622 ms etc.. I gave only the order of the time spend rounded to hundreds. Bye