|
Message-ID: <e0cbed21021ca16b8b4efb6e103e90b9@smtp.hushmail.com> Date: Wed, 30 Sep 2015 23:13:49 +0200 From: magnum <john.magnum@...hmail.com> To: john-dev@...ts.openwall.com Subject: Re: fast hash early exit vs. large hash list On 19/09/15 15:58, Solar Designer wrote: > BTW, here's a compiler trick to produce specialized functions without > cluttering the source code: > > static MAYBE_INLINE void generic(int flag1, int flag2, int choice1) > { > ... > if (flag1) { > ... > } > ... > } > > static void special1(void) > { > generic(1, 0, 5); > } > and so on. Where MAYBE_INLINE is our macro that tries to force function > inlining regardless of limits on function size. Optimizing compilers > are able to substitute the constants and eliminate the branches and dead > code (that would have resulted from naive inlining with no optimization). I tried inlining like that, vs. using special functions with a macro for the actual MD5. The net results should be the same but for some reason the macro version is 5-10% faster. I'm trying to figure out why, maybe I need to dig into the asm :-/ magnum
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.