<script> Benchmark.prototype.setup=function(){ function go(){ $hashCode$String(''); $hashCode$String('Hello'); $hashCode$String('a man a plan a canal panama'); } }; </script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
Testing in unknown unknown
Test
Ops/sec
b29
function $hashCode$String(s){ var hash =0, len = s.length, mask =((1<<29)-1); for(var i =0; i < len; i++){ var ch = s.charCodeAt(i); hash =(hash + ch)& mask; hash =(hash +((hash &(mask >>10))<<10))& mask; hash =(hash ^(hash >>6)); }
0 comments