Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Eric Sosman Newsgroups: comp.lang.java.programmer Subject: Re: Passing a Method Name to a Method Date: Fri, 24 Jun 2011 07:48:06 -0400 Organization: A noiseless patient Spider Lines: 29 Message-ID: References: <81h4075t4gfjglji1n033rb20025ebho68@4ax.com> <5qc707508v2bousjol7rs74rftkc5mn09u@4ax.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Fri, 24 Jun 2011 11:48:55 +0000 (UTC) Injection-Info: mx04.eternal-september.org; posting-host="BrOwaJANne849xlH+KPYjQ"; logging-data="32228"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19ZdG/tHX7dwfTq6s+d+r9E" User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10 In-Reply-To: <5qc707508v2bousjol7rs74rftkc5mn09u@4ax.com> Cancel-Lock: sha1:h/kOOI5ZOjf+990X6oCvxMmBxUI= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5638 On 6/23/2011 5:44 PM, Gene Wirchenko wrote: > On Wed, 22 Jun 2011 22:30:42 -0400, Joshua Cranmer > wrote: > > [snip] > >>> static returntype ThisWay(formal parms) >>> {...} >>> >>> static returntype ThatWay(formal parms) >>> {...} >> >> Why are you having static methods (on the same class, I presume) for two >> different ways of parsing instead of using separate parser classes? > > I am not writing different parsers. I am writing different > methods for handling a small (but frequently called) part of the > parsing. I wish to test how fast each of these methods are. As an aside: You're certainly aware that micro-benchmarks are easy to concoct, but notoriously difficult to interpret. In Java, concoction is equally easy but interpretation is *much* harder. "Do X N times, do Y N times, measure the elapsed times" simply doesn't work well in the face of just-in-time compilation, garbage collection, the loading of ancillary classes, and so on. -- Eric Sosman esosman@ieee-dot-org.invalid