Path: csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.musoftware.de!wum.musoftware.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Rainer Weikusat Newsgroups: comp.programming,comp.unix.programmer Subject: Re: hash function over IP address Date: Thu, 05 Apr 2012 19:38:40 +0100 Lines: 21 Message-ID: <87d37m3txr.fsf@sapphire.mobileactivedefense.com> References: <87hawzyy3z.fsf@blp.benpfaff.org> <87398jw4ep.fsf@sapphire.mobileactivedefense.com> <87d37nyvjw.fsf@blp.benpfaff.org> <87k41uo2ph.fsf@sapphire.mobileactivedefense.com> <87sjgi3xxr.fsf@sapphire.mobileactivedefense.com> <_xkfr.45660$QC3.18854@newsfe16.iad> <87lima3wxi.fsf@sapphire.mobileactivedefense.com> <5flfr.2467$Nk2.1380@newsfe08.iad> <87hawy3u46.fsf@sapphire.mobileactivedefense.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: individual.net s/Bx0KJSPnzp9qLqELKsxgeLdJPItugUMgPle2hkUDRSSpp7c= Cancel-Lock: sha1:Xa5nxoQSnoxRSN3zwkrV+JdpyJg= sha1:ZRQ+sXQmI0ZRyqo6CLBZ955XWqU= User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux) Xref: csiph.com comp.programming:1437 comp.unix.programmer:2378 Rainer Weikusat writes: [...] >>>>> Really. If calculating the hash value is more expensive than the >>>>> comparisons it is supposed to avoid, it obviously buys you nothing. >>>> A single hash is supposed to save you multiple comparisons, not a >>>> single comparison, >>> >>> An the letter 's' following a word, as in comparisonS, is supposed to >>> indicate a plural. >> Yes, I single hash operation is used so that you can avoid multiple >> (meaning plural) comparisons. I said exactly what I meant, and meant >> exactly what I said. My point still stands. A hash can be slower than >> a comparison, and still save you a significant amount of time. > > And so did I, superbrain. Please pester someone else in future. And just in case there are more 'Blitzmerkers' of this kind around here: I was referring to the complete set of comparisons that would need to be done for a search without hashing all the time.