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="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
$(document).ready(function(){
// tooltip for Guest section
$("#passenger .resultItem ul li #edocsVS").wrap("<div class='guestToolTipWrap' />");
$('#passenger .resultItem ul li .guestToolTipWrap').append('<span>'+$('.edocsGuestTooltip').html()+'</span>');
// Preventing onClick of eDocs link
$("#edocsVS").click(function(event){
event.preventDefault();
});
$("#dwnldEdocsWithoutLink").click(function(event){
event.preventDefault();
});
//adding class on every third item added in guest section
$("#page-bge-vacation-summary #passengerHolder .item-list ul li.guestChkBox:nth-child(3n+1)").addClass("first");
$('#daysWrapper').css('left','0');
$("#milestones .ticker").click(function() {
$('.ticker').removeClass('active');
$(this).addClass('active');
$('#msgContainerVS .msgContainer:visible').removeClass('active').addClass('inactive');
var tick = '.' + $(this).attr("rel");
$(tick).removeClass('inactive').addClass('active');
return false;
});
//Set default open/close settings
$('#vaca .categoryCnt, #page-bge-explore-plan-spa-pages .categoryCnt').hide();
$('#vaca #suggestionProduct .categoryCnt').show();//Hide/close all containers for spa view
$('#vaca .acc_trigger:first, #page-bge-explore-plan-spa-pages .acc_trigger:first').parent().next().show(); //Add "active" class to first trigger, then show/open the immediate next container
$('#vaca .acc_trigger').click(function(){
$(this).toggleClass('expand').parent().next().slideToggle(); //Add .acc_trigger class to clicked trigger and slide down the immediate next container
$(this).parent().next().next().toggle();
return false; //Prevent the browser jump to the link anchor
});
//Accordion for Spa Page
$('#spaView .topDescription, #spaView .categoryCtn, #spaView .bttop_icon').hide();
$('.categoryResults').eq(0).children().show();
$('.categoryResults:first .topDescription').show();
$('#spaView .categoryResults:first .acc_trigger').removeClass('expand');
$('#spaView .categoryResults .acc_trigger').click(function(){
$(this).toggleClass('expand');
$(this).parent().parent().next().slideToggle(); //Hide categoryCtn
$(this).parent().parent().next().next().toggle(); //Hide bttop_icon
$(this).parent().next().toggle(); //Hide topDescription
return false; //Prevent the browser jump to the link anchor
});
//End Spa Accordion
var count=$('#getPassenger').text();
//var x=parseInt(count)+1;
$('#passenger .resultItem .fl').hide();
$('#passenger .resultItem .fl:lt('+count+')').show();
/*create tabs based on days*/
var getTabCount=$('#daysWrapper .tab').length;
var tabWidth=121;
var divWidth=(tabWidth)*(getTabCount+5);
$('#daysWrapper').css('width',divWidth);
var visibleTab=$('#daysWrapper .tabit').eq(5);
//Trigger event for right arrow
$('.right_arrow0, .NextBtn').click(function(){
var getLeft=$(this).parent().parent().css('left');
getLeft=parseInt(getLeft);
var setLeft=getLeft-860;
$('#daysWrapper').animate({
left:setLeft+'px'
},500);
});
$('.prevLink0, .PreviousBtn').click(function(){
var getLeft=$(this).parent().parent().css('left');
getLeft=parseInt(getLeft);
var setLeft=getLeft+860;
$('#daysWrapper').animate({
left:setLeft+'px'
},500);
});
//method for clickin on itenary days
$('#itineraryContainer .it-table td a').click(function(event){
var getLeft=0;
event.preventDefault();
var getIndex=$(this).attr('id');
getIndex=parseInt(getIndex);
var tabWidth=121;
var moveNumber = getIndex/5;
//show selected day tabs and its container
selectTab(getIndex);
for (i = 1;i < moveNumber;i++) {
getLeft=parseInt(getLeft);
var setLeft=getLeft-860;
$('#daysWrapper').animate({
left:setLeft+'px'
},500);
getLeft = setLeft;
}
});
$('#itineraryContainer .tabWrapper .tabCnt').hide();
//trigger tab event
$('#tabz .tabit').click(function(){
if($(this).hasClass('default')){
$('#tabz .tabit').removeClass('active');
$(this).addClass('active');
$('#itineraryContainer #default').show();
}
else{
$('#itineraryContainer .tabWrapper .tabCnt').hide();
$('#default').hide();
var getid=$(this).attr('rel');
$(getid).show();
$('#tabz .tabit').removeClass('active');
$(this).addClass('active');
}
});
$('#tabz .whiteback').click(function(){
$('#itineraryContainer .tabWrapper .tabCnt').hide();
$('#default').show();
});
//method to select tabs based on days
function selectTab(getIndex){
$('#daysWrapper .tabit').eq(getIndex).addClass('active');
$('.tabWrapper #default').hide();
$('.tabWrapper .tabCnt').eq(getIndex-1).show();
$('#tab0').removeClass('active');
}
});
//removing sticky header from vacation summary page
$(function(){
$('#page-bge-vacation-summary table.sticky-header').remove();
});
Ready to run.
Test | Ops/sec | |
---|---|---|
vs2 |
| ready |
vs3 |
| ready |
You can edit these tests or add more tests to this page by appending /edit to the URL.