Path: csiph.com!newsfeed.hal-mli.net!feeder3.hal-mli.net!newsfeed.hal-mli.net!feeder2.hal-mli.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: simple StringBuilder proposal Date: Fri, 01 Mar 2013 07:35:43 +0100 Lines: 29 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net Rw93fd/asPTs7jgUeQoVjgSuCoW0oBafMCIS29zh/A8HsNFP4y3UuTfsniui11QpY= Cancel-Lock: sha1:TU5NWkHoy0FAncu7D39uQP7D1jI= User-Agent: Mozilla/5.0 (Windows NT 6.0; WOW64; rv:17.0) Gecko/20130215 Thunderbird/17.0.3 In-Reply-To: Xref: csiph.com comp.lang.java.programmer:22643 On 27.02.2013 00:54, markspace wrote: > On 2/26/2013 1:53 PM, Robert Klemme wrote: > >> I cannot really recall what class it was but there is a class which has >> an overloaded method with single arguments for the case 1 to 3 and then >> has a catch all with vararg. Like this > > EnumSet, and there's five of them, not three. Ah, yes! Thank you for helping my feeble memory, Mark! > It's a rather extreme > case of "let's make this as fast as possible, even to compile directly > to one machine instruction" rather than a general heuristic. > > Actually I had similar thoughts: EnumSet seemed quite aggressive optimized. There's also the two bit set implementations underneath (long and BitSet) which seem to indicate Oracle's engineers expect heavy use of Enums. Kind regards robert -- remember.guy do |as, often| as.you_can - without end http://blog.rubybestpractices.com/