Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Robert Klemme Newsgroups: comp.lang.java.programmer Subject: Re: Autoboxing and Performance ? Date: Mon, 26 Aug 2013 19:33:43 +0200 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: quoted-printable X-Trace: individual.net DGq7QYgk46MzlKfKB75lvwf3QyII34DdfMmNzEZ4H5YCvR90Y= Cancel-Lock: sha1:jlo+pRnhqviuN0sd5ZdUQfRXdkM= User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130803 Thunderbird/17.0.8 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:25142 On 08/21/2013 02:52 AM, Sven K=F6hler wrote: > That said, I seriously think that all the wrapper classes were just > intended for what the name suggests: wrapping a primitive type when you= > really need an Object. And most of the time you don't need an object. I tend to agree. But that totally depends on the type of applications=20 you are dealing with. Just as a data point: object types are not necessarily that expensive.=20 I once wrote a hash map with int as key type (basically copying=20 java.util.HashMap) just to find out that the performance difference to a = standard HashMap with Integer as keys was negligible. (I don't remember = all the details but I believe I also used values outside the cached range= =2E) > I'd even call program is seriously broken if it uses Integer where int > could be used. I was never in need of a mutable Integer. Then you probably never used reflection. Which is another good reason=20 to have java.lang.Integer and the like. Cheers robert