[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1388816 - in /subversion/branches/10Gb/subversion: include/private/svn_pseudo_md5.h libsvn_subr/cache-membuffer.c libsvn_subr/pseudo_md5.c tests/libsvn_subr/checksum-test.c

From: Stefan Fuhrmann <stefan.fuhrmann_at_wandisco.com>
Date: Sun, 23 Sep 2012 14:49:16 +0200

On Sat, Sep 22, 2012 at 8:12 PM, Blair Zajac <blair_at_orcaware.com> wrote:

> On 09/22/2012 08:14 AM, stefan2_at_apache.org wrote:
>
>> Author: stefan2
>> Date: Sat Sep 22 15:14:25 2012
>> New Revision: 1388816
>>
>> URL: http://svn.apache.org/viewvc?**rev=1388816&view=rev<http://svn.apache.org/viewvc?rev=1388816&view=rev>
>> Log:
>> On the 10Gb branch: Introduce MD5-based hash functions optimized
>> for short input lengths. Use these to speed up membuffer access.
>>
>
> How much faster is it than a plain MD5?
>

The 16-byte version is twice as fast as the MD5 core
due to the fact that we know much of the input to be 0
and can hard-code it as such. In addition to that, the
APR implementation has a ~100% overhead (setting
up the context etc.) for strings that fit into a single
encoding block. In total, the pseudo-MD5 code is
3..4 times as fast as apr_md5.

> If we only need it for hashing, did you look at using a more well known
> hashing function, e.g. FNV [1] or murmur [2]?
>

FNV-128 would be just as slow as pseudo-MD5 as it
takes one iteration per byte and about 17(?) operations
per iteration.

murmur is not exactly "well-known" as it is quite new.

However, non of that really matters. The key is that we
need cryptographic strength for the hashes we use in
membuffer because they are the *only* identification for
any object stored therein. Basically the same scheme
as the SHA-1 usage in our working copy.

> Also, can you include URLs where you downloaded the code from in the log
> message and code.
>

So, you did not read the code ;) Simply read the first
65 lines of pseudo_md5.c

I downloaded the original version from some admittedly
obscure location in the rather shady party of the interwebs:

https://svn.apache.org/repos/asf/apr/apr-util/tags/1.3.12/crypto/apr_md5.c

-- Stefan^2.

-- 
*
Join us this October at Subversion Live
2012<http://www.wandisco.com/svn-live-2012>
 for two days of best practice SVN training, networking, live demos,
committer meet and greet, and more! Space is limited, so get signed up
today<http://www.wandisco.com/svn-live-2012>
!
*
Received on 2012-09-23 14:49:49 CEST

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.