I implemented a few functions responding on the scroll event, it seems like document.body.scrollTop and document.body.scrollLeft do not cache it's calls between scroll events. This leads to heavy performance difficulties if you dont cache it yourself. I dont see why this call is not cached or why it is so expensive?
You can easily see it attaching a scroll event listener to your page e.g. jQuery
jQuery(window).scroll(function() {
// do stuff with document.body.scrollLeft and document.body.scrollTop
document.body.scrollLeft;
document.body.scrollTop;
document.body.scrollLeft;
document.body.scrollTop;
document.body.scrollLeft;
document.body.scrollTop;
document.body.scrollLeft;
document.body.scrollTop;
});
add those up and see your fps drop in timeline.