Path: csiph.com!x330-a1.tempe.blueboxinc.net!newsfeed.hal-mli.net!feeder3.hal-mli.net!news.glorb.com!feeder.erje.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: Tue, 05 Jul 2011 14:06:39 -0700 Organization: A noiseless patient Spider Lines: 24 Message-ID: References: <9796kgFoijU3@mid.individual.net> <979v96F7epU1@mid.individual.net> <97h616FhaeU3@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="14189"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX183+0XBYzMnucST/g4tMQcofNJ+7/0A/lI=" X-Newsreader: Forte Agent 4.2/32.1118 Cancel-Lock: sha1:XchT5L1h5E1nIMu/1GnnXIqrzRQ= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:5870 On 5 Jul 2011 19:12:39 GMT, blmblm@myrealbox.com wrote: [snip] >What I found is that HashSet was noticeably faster on all the >systems where I ran the benchmarks. Unless you need for the set >to be sorted (and it's not apparent from your code that you do), >why not .... ? (I'm curious too about why you chose TreeSet in >the first place. ? ) 1) I can output the set in order without having to do anything else. My real program has a lot of debugging info dumping. (Read as "checks that I have not done something wrong".) 2) When I read "hash", I think "collision", and I get nervous. Nothing I read reassured me that that could not happen. 3) I had to pick something. If it works, I can change it later. If it does not, I have not solved my problem yet. The former is safer. Sincerely, Gene Wirchenko