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 08:08:49 +0300 Lines: 19 Message-ID: References: <5215427f$0$299$14726298@news.sunsite.dk> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: news.dfncis.de So43yF5/JHnm/0xHtHvUlQ+2gPxH3Ucy1WpeiQelMbFEea6YXMYfcc+ohX Cancel-Lock: sha1:FYKozYtnXFTJXO6YdC6acgRZhOU= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130807 Thunderbird/17.0.8 In-Reply-To: <5215427f$0$299$14726298@news.sunsite.dk> Xref: csiph.com comp.lang.java.programmer:25102 Am 22.08.2013 01:43, schrieb Arne Vajhøj: > And C# that was born with int as an object and therefore did > not get wrapper classes later had to add int? to get a > nullable int. So C# distinguishes between int and int? - the former being non-nullable and the latter being nullable. I can easily subscribe to the point of view, that C# does everything such that the programmer is provided with the illusion that a variable of type int is actually an object. However, I wonder whether converting int to int? and back again might not be implemented using some form of boxing and unboxing - maybe even with a comparable performance hit. Certainly, the (un)boxing can be optimized away in some cases - but not all of them. Regards, Sven