Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!feeder.erje.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Joshua Cranmer Newsgroups: comp.lang.java.programmer Subject: Re: setSize ArrayList, when will it come? Date: Wed, 10 Aug 2011 18:22:31 -0500 Organization: A noiseless patient Spider Lines: 14 Message-ID: References: <9aetckFmvmU1@mid.individual.net> <9aftbqFa9kU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Wed, 10 Aug 2011 23:22:37 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="B3q1fNdvNsCxx/IZ4idKGA"; logging-data="32552"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JS94Z2nhUzxTQRGj3ClfwoPiFMQWQtqw=" User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 In-Reply-To: Cancel-Lock: sha1:fvjWowYygPIMuRb6tppoEE1oYcc= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:6997 On 8/10/2011 1:37 PM, Jan Burse wrote: > Look see: Migrating from Vector to ArrayList is all > about energy saving. ArrayList does not use synchronized, > therefore it does use less CPU. But in my case the > migration is not perfect, since setSize() is missing. We have given *several* ways to re-emulate setSize using ArrayList. Since moving from Vector to ArrayList causes savings in loss of synchronized, perhaps the speed slowdown in your emulations is more than made up for. -- Beware of bugs in the above code; I have only proved it correct, not tried it. -- Donald E. Knuth