Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!fu-berlin.de!uni-berlin.de!news.dfncis.de!not-for-mail From: =?ISO-8859-1?Q?Sven_K=F6hler?= Newsgroups: comp.lang.java.programmer Subject: Re: Autoboxing and Performance ? Date: Thu, 22 Aug 2013 07:56:48 +0300 Lines: 16 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Trace: news.dfncis.de /lkTurenjcnD3wYlktJxswm39e00+wvlwfmVbz70VZ78kICvb/LdPhu1+w Cancel-Lock: sha1:G90pRVfVjFRde62Yr67vvQXHDSs= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130807 Thunderbird/17.0.8 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:25101 Am 21.08.2013 08:27, schrieb Sebastian: > What do you think? Is simply wanting to have a "null" value a valid > reason for using Integer instead of int? If you just store the value like that, that is probably just fine. However, if I see your program actually working with that nullable int and thus unboxing/reboxing it over and over again, then that should probably be criticized if the code path is performance critical. Also, it is a fact that having hundreds and thousands of Integer objects take probably 4 times more space than having the same number of ints. I guess, I'd rather not like to settle on a general yes/no - it depends. Regards, Sven