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
const isString = (x) => typeof x === 'string';
const shortString = 'test';
const longString = 'oilu43hrfewnmz 98 8 uidhjas 9-80rh34fuiaewrh4 yq2389riaewrh4 yq2389ry fuehnwfc sepof uq-89 32hfrn sdugfh sd-0389rhqfaiubsd uifs-ea 98 rew;rfnsf -98 23uiofn jikds n fdsa-8g43riufbewiuaewhf c-sd8afesdaufnewarkferwaf-89ewfhuewifhui aef-e89afghjkfdnf a-f8 pufbaewfgewh a-f9e8 yfdiusbafy fuehnwfc sepof uq-89 32hfrn sdugfh sd-0iaewrh4 yq2389ry fuehnwfc sepof uq-89 32hfrn sdugfh sd-0389rhqfaiubsd uifs-ea 98 rew;rfnsf -98 23uiofn jikds n fdsa-8g43riufbewiuaewhf c-sd8afesdaufnewarkferwaf-89ewfhuewifhui aef-e89afghjkfdnf a-f8 pufbaewfgewh a-f9e8 yfdiusbaf389rhqfaiubsd uifs-ea 98 rew;rfnsf -98 23uiofn jikdsiaewrh4 yq2389ry fuehnwfc sepof uq-89 32hfrn sdugfh sd-0389rhqfaiubsd uifs-ea 98 rew;rfnsf -98 23uiofn jikds n fdsa-8g43riufbewiuaewhf c-sd8afesdaufnewarkferwaf-89ewfhuewifhui aef-e89afghjkfdnf a-f8 pufbaewfgewh a-f9e8 yfdiusbaf n fdsa-8g43riufbewiuaewhf c-sd8afesdaufnewarkferwaf-89ewfhuewifhui aef-e89afghjkfdnf a-f8 pufbaewfgewh a-f9e8 yfdiusbafjdks af-dsa89f awhfjeksnafd';
const stringsObj = {
shortString: shortString,
longString: longString,
}
const testByCallback = (value, callback) => callback(value);
const testPropertyByCallbackShort = (obj, callback) => callback(obj.shortString);
const testPropertyByCallbackLong = (obj, callback) => callback(obj.longString);
Ready to run.
Test | Ops/sec | |
---|---|---|
typeof === 'string' (short) |
| ready |
instanceof String (short) |
| ready |
isString (short) |
| ready |
testByCallback (short) |
| ready |
testPropertyByCallback (short) |
| ready |
typeof === 'string' (long) |
| ready |
instanceof String (long) |
| ready |
isString (long) |
| ready |
testByCallback (long) |
| ready |
testPropertyByCallback (long) |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.