jsPerf.app is an online JavaScript performance benchmark test runner & jsperf.com mirror. It is a complete rewrite in homage to the once excellent jsperf.com now with hopefully a more modern & maintainable codebase.
jsperf.com URLs are mirrored at the same path, e.g:
https://jsperf.com/negative-modulo/2
Can be accessed at:
https://jsperf.app/negative-modulo/2
String.prototype.UInt16_a = function(n) {
return this.charCodeAt(n) + 256 * this.charCodeAt(n + 1);
};
String.prototype.UInt16_b = function(n) {
return this.charCodeAt(n) + (this.charCodeAt(n + 1) << 8);
};
function UInt16_c() {}
UInt16_c.prototype.func = function(s, n) {
return s.charCodeAt(n) + 256 * s.charCodeAt(n + 1);
};
function UInt16_d() {}
UInt16_d.prototype.func = function(s, n) {
return s.charCodeAt(n) + (s.charCodeAt(n + 1) << 8);
};
var u16_c = new UInt16_c();
var u16_d = new UInt16_d();
var input = "Ax";
var output = 0;
var n = 0;
Ready to run.
Test | Ops/sec | |
---|---|---|
(String)Prototype - mul |
| ready |
(String)Prototype - shift |
| ready |
Prototype - mul |
| ready |
Prototype - shift |
| ready |
Inline - mul |
| ready |
Inline - shift |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.