Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!news.albasani.net!eternal-september.org!feeder.eternal-september.org!.POSTED!not-for-mail From: Gene Wirchenko Newsgroups: comp.lang.java.programmer Subject: Re: StringBuilder Difficulties Date: Mon, 04 Jul 2011 08:04:33 -0700 Organization: A noiseless patient Spider Lines: 43 Message-ID: References: <976q3jF3etU2@mid.individual.net> <9796kgFoijU3@mid.individual.net> <979v96F7epU1@mid.individual.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Injection-Info: mx04.eternal-september.org; posting-host="7Qrvczazr82YckO5XW8Vtw"; logging-data="5644"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX18xD4sUIpzPbwzEGycOXOTHvC3vFxpZBRY=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:Xtm5b2FAq/hLb+KXp+d5pjzc85g= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5851 On 3 Jul 2011 01:34:30 GMT, blmblm@myrealbox.com wrote: >In article <9796kgFoijU3@mid.individual.net>, >blmblm@myrealbox.com wrote: >> In article , >> Gene Wirchenko wrote: >> > On 1 Jul 2011 20:47:47 GMT, blmblm@myrealbox.com >> > wrote: >> > >> > >In article <6cqp07tiug2nu8u6ififvvek1694fkpfi1@4ax.com>, >> > >Gene Wirchenko wrote: >> > >> On 30 Jun 2011 20:30:00 GMT, blmblm@myrealbox.com >> > >> wrote: > >[ snip ] >UPDATE: I just re-read the previous threads and realized that >your code actually calls SequentialSearch in the method that's >supposed to be timing BinarySearch. Once I fix that .... Yeah, I caught that goof later, too. Or was that one pointed out? There was at least one goof that got pointed out to me. Cut and paste is a horrible way to have to do it. [snip] >Both programs (yours and mine) now consistently report sequential >search to be faster than binary search. Weird, but not as weird as >the two being different in that regard .... That is not the result that I got. Sequential search was occasionally faster but usually a bit slower the binary search. Someone posted links about the difficulty of Java benchmarking. If it really mattered (checking for *small* differences), I would use them and may well in a future test when it does. The difference between the binary search and the Treeset search was sufficiently and consistently different that I went with Treeset. Sincerely, Gene Wirchenko