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
Testing evaluation of all RegEx at once... New Test3 is faster on my browser...
<script>
var ios, android, blackBerry, windows, smartphone, tablet, all;
var mobileCheck = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}()),
android: (function(){
return navigator.userAgent.match(/Android/i);
}()),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}()),
windows: (function(){
return navigator.userAgent.match(/IEMobile/i);
}()),
smartphone: (function(){
return (window.innerWidth <= 384 && window.innerHeight <= 640);
}()),
tablet: (function(){
return (navigator.userAgent.match(/Tablet|iPad|iPod/i) && window.innerWidth <= 1280 && window.innerHeight <= 800);
}()),
all: (function(){
return navigator.userAgent.match(/Android|BlackBerry|Tablet|Mobile|iPhone|iPad|iPod|Opera Mini|IEMobile/i);
}())
};
var mobileCheck_2 = {
ios: (function(){
return navigator.userAgent.match(/iPhone|iPad|iPod/i);
}),
android: (function(){
return navigator.userAgent.match(/Android/i);
}),
blackBerry: (function(){
return navigator.userAgent.match(/BB10|Tablet|Mobile/i);
}),
windows: (function(){
return navigator.userAgent.match(/IEMobile/i);
}),
smartphone: (function(){
return (window.innerWidth <= 384 && window.innerHeight <= 640);
}),
tablet: (function(){
return (navigator.userAgent.match(/Tablet|iPad|iPod/i) && window.innerWidth <= 1280 && window.innerHeight <= 800);
}),
all: (function(){
return navigator.userAgent.match(/Android|BlackBerry|Tablet|Mobile|iPhone|iPad|iPod|Opera Mini|IEMobile/i);
})
};
var mobileCheck_3 = function() {
return {
ios: navigator.userAgent.match(/iPhone|iPad|iPod/i),
android: navigator.userAgent.match(/Android/i),
blackBerry: navigator.userAgent.match(/BB10|Tablet|Mobile/i),
windows: navigator.userAgent.match(/IEMobile/i),
smartphone: (window.innerWidth <= 384 && window.innerHeight <= 640),
tablet: (navigator.userAgent.match(/Tablet|iPad|iPod/i) && window.innerWidth <= 1280 && window.innerHeight <= 800),
all: navigator.userAgent.match(/Android|BlackBerry|Tablet|Mobile|iPhone|iPad|iPod|Opera Mini|IEMobile/i)
}
};
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
mobileCheck |
| ready |
mobileCheck_2 |
| ready |
mobileCheck_3 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.