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
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div id="remove">
</div>
<div id="remove2">
</div>
<div id="remove3">
</div>
<script>
$elem = $("#remove");
$elem2 = $("#remove2");
$elem3 = $("#remove3");
function showElement(element) {
element[0].style.display = "block";
}
function hideElement(element) {
element[0].style.display = "none";
}
function showElements(elementsArray) {
for (var el in elementsArray) {
elementsArray[el][0].style.display = "block";
}
}
function hideElements(elementsArray) {
for (var el in elementsArray) {
elementsArray[el][0].style.display = "none";
}
}
function showElements2(elementsArray) {
$.each(elementsArray, function() {
$(this)[0].style.display = "block";
});
}
function hideElements2(elementsArray) {
$.each(elementsArray, function() {
$(this)[0].style.display = "none";
});
}
function showWithHelp(elements, isArray){
isArray = isArray || false;
if (isArray) for (var i in elements) elements[i][0].style.display = 'block';
else elements[0].style.display = 'block';
}
function hideWithHelp(elements, isArray){
isArray = isArray || false;
if (isArray) for (var i in elements) elements[i][0].style.display = 'none';
else elements[0].style.display = 'none';
}
function showClass(element) {
element.addClass('hideEl');
}
function hideClass(element) {
element.removeClass('hideEl');
}
</script>
Ready to run.
Test | Ops/sec | |
---|---|---|
show/hide |
| ready |
jquery css |
| ready |
css 1 |
| ready |
function |
| ready |
css 2 |
| ready |
jquery css {} |
| ready |
fn $-array 1 |
| ready |
fn $-array 2 |
| ready |
fn with help (single) |
| ready |
fn with help (array) |
| ready |
add remove class |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.