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
What is faster? Comparing a number or comparing a string?
<script>
var a1 = '12345678',
a2 = '87654321',
a3 = '12345678';
var b1 = '12345678123456781234567812345678123456781234567812345678',
b2 = '87654321876543218765432187654321876543218765432187654321',
b3 = '12345678123456781234567812345678123456781234567812345678';
var c1 = 0xFFFFFFFFAACCFF00,
c2 = 0xFFFFFFFFFFFF0001,
c3 = 0xFFFFFFFFAACCFF00;
var d1 = 1.524198274617236125290185273,
d2 = 1.524198274617232125290185273,
d3 = 1.524198274617236125290185273;
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
Short String |
| ready |
Long String |
| ready |
uint |
| ready |
float |
| ready |
string short equal |
| ready |
string long equal |
| ready |
uint equal |
| ready |
float equal |
| ready |
switch string |
| ready |
switch numeric |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.