UUID golf

JavaScript performance comparison

Test case created by Jed Schmidt

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    build = function(a,b){for(b=a='';a++<36;b+=~a%5|a*3&4?(a^15?8^Math.random()*(a^20?16:4):4).toString(16):'-');return b}
   
    replace = function b(a){return a?(a^Math.random()*16>>a/4).toString(16):([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g,b)}
};
</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
build()
build()
pending…
replace()
replace()
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment