Murmur3 vs MD5 (v2)

Revision 2 of this benchmark created on


Preparation HTML

<script src="https://raw.github.com/garycourt/murmurhash-js/master/murmurhash3_gc.js">
</script>
<script src="https://raw.github.com/blueimp/JavaScript-MD5/master/md5.js">
</script>

Setup

var alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789!@#$%^&*()_+-=`[]\\;',./{}|:\"<>?",
      alphabetLength = alphabet.length;
  
  var testStrings = [],
      i = 0,
      j = 0,
      testCount = 100,
      length = 50;
  for (i = 0; i < testCount; i++) {
    var newStr = "";
    for (j = 0; j < length; j++) {
      newStr += alphabet[Math.floor((Math.random() * alphabetLength))];
    }
    testStrings[i] = newStr;
  }

Test runner

Ready to run.

Testing in
TestOps/sec
MurmurHash3
for (i = 0; i < testCount; i++) {
  murmurhash3_128_gc(testStrings[i], 6802145);
}
ready
MD5
for (i = 0; i < testCount; i++) {
  md5(testStrings[i]);
}
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.