Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!feeder2.ecngs.de!ecngs!feeder.ecngs.de!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: Sun, 25 Nov 2012 07:42:58 -0600 From: "Chris Uppal" Newsgroups: comp.lang.java.programmer References: <8i70b8d0pm6ibk03ti4t2pv60jd0bctlcs@4ax.com> <8ip0b8p7blu31eub502so8cus1h9so3m9s@4ax.com> Subject: Re: optimsed HashMap Date: Sun, 25 Nov 2012 13:40:55 -0000 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2900.5512 X-RFC2646: Format=Flowed; Response X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.5512 Message-ID: Lines: 22 X-Usenet-Provider: http://www.giganews.com X-AuthenticatedUsername: NoAuthUser X-Trace: sv3-P73++4YqkMO7f1dZ+LSXxPNB9IhdlBkcf7uzFgYAEzvPG/yLtxBVydGEdRhHkGBXJnj3MD4EfimrA/Q!eexNwZP6hxXktBxAo2CPlct7hkN9AKjULvZ+5qnOegVo65dQen37bVpra7JxxCba9F/BJLDcBpQ= 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: 2085 Xref: csiph.com comp.lang.java.programmer:19932 markspace wrote: > I think it's unlikely that you're going to get a better algorithm than > Boyer-Moore or some other standard algorithm. Those are standard > algorithms for a reason: no one's come up with anything better. The current state-of-the-art lies well beyond Boyer-Moore (or Boyer-Moore-Horspool). But I agree with the main point you make. There are standard algorithms; use them! > You might try compiling a regex to do it. Regex can be pretty efficient > in many cases. If there is a need for extreme speed (as yet unproven) then I'd be very wary of the Java built-in regexp implementation. At least the last time I looked (several years ago) it used some wretched non-linear backtracking implementation even when it wasn't forced to (by someone feeding it Perl-style "regexps"). -- chris