Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!eu.feeder.erje.net!border3.nntp.ams.giganews.com!Xl.tags.giganews.com!border1.nntp.ams.giganews.com!nntp.giganews.com!local2.nntp.ams.giganews.com!nntp.bt.com!news.bt.com.POSTED!not-for-mail NNTP-Posting-Date: Sat, 24 Nov 2012 04:29:36 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <8i70b8d0pm6ibk03ti4t2pv60jd0bctlcs@4ax.com> <5Yidnbg3DrTK2S3NnZ2dnUVZ_uudnZ2d@earthlink.com> Subject: Re: optimsed HashMap Date: Sat, 24 Nov 2012 10:21:14 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 X-RFC2646: Format=Flowed; Response Message-ID: Lines: 19 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-fohKlhI7w7ouvT62alWwkZKHYkmlv1Utke+OOK+E0x1vXPel0HKjzsEJbnfPz7l7gTpWhrM+8tqkPg4!yumBeYE6fGWnOK8Bq29YgnNan03aiYzm30yNXDFqRxzAVtX1C9f5YG5O+XxIMBRuENRd06PkgXM= X-Complaints-To: abuse@btinternet.com X-DMCA-Complaints-To: abuse@btinternet.com X-Abuse-and-DMCA-Info: Please be sure to forward a copy of ALL headers X-Abuse-and-DMCA-Info: Otherwise we will be unable to process your complaint properly X-Postfilter: 1.3.40 X-Original-Bytes: 1868 Xref: csiph.com comp.lang.java.programmer:19890 Patricia Shanahan wrote: > > Is there something like HashMap but that optimised when nearly always > > the thing you are looking up is not in the list, and when you can add > > the list of words to look up and then freeze it. [...] > Look up "perfect hash". Also worth considering (assuming that the standard HashSet isn't doing the job well enough): Use hash set with a better hash function (but not a pre-computed perfect hash). Look into the literature on fast text searching (for instance bit-parallel matching). It's not entirely clear to me what Roedy is trying to do, but it sounds as if "bulk" matching/searching might be relevant. -- chris