Test123123123fgdhfdrtgt
JavaScript performance comparison
Preparation code
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
Benchmark.prototype.setup = function() {
UUID = GenID = function (mode,rint) {
switch (mode) {
case 1:
var seed = (rint?rint:Math.floor((Math.random()*0x75bcd15)+(Math.random()*0x75bcd15)));
return parseInt(((new Date()).getTime()+seed),36).toString(16);
case 2:
return (function(a,b){for(b=a='';a++<36;b+=a*51&52?(a^15?8^Math.random()*(a^20?(rint?rint:16):4):4).toString(16):'-');return b})();
case 3:
return Math.random().toString(36).split('.')[1].substring((rint?rint:5));
default:
return 'xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx'.replace(/[xy]/g, function(c) {
var r = Math.random()*16|0; return (c=='x'?r:(r&0x3|0x8)).toString(16);
});
};
};
};
</script>
Test runner
Warning! For accurate results, please disable Firebug before running the tests. (Why?)
Java applet disabled.
| Test | Ops/sec | |
|---|---|---|
Gen |
|
pending… |
Gen2 |
|
pending… |
You can edit these tests or add even more tests to this page by appending /edit to the URL.
0 comments