I found this strange behavior that only happens to me on Windows Server 2008 R2.
your tester is not a correct indication, as it checks the performance with a random function that can lead to different results for each sample, moreover, you do not exclude console.profile () and console.profileEnd () from the temporary selection, which means that you have never had real initial results.
To get a better and more realistic result, the code should look like this:
var random = [80,90,15,5,70,50,60,25,36,45,62,58,76,23,93]; fbtn.addEventListener('click', function() { //START PROFILE BEFOR TIME START if (withProfiling.checked) { console.profile(); } console.time('click handler'); for (var i = 0, v =0; i < 1000000; i++, v++) { box.style.top = random[v] + '%'; //USE SAME NUMBERS FOR ALL TESTS box.style.left = random[v] + '%';//USE SAME NUMBERS FOR ALL TESTS if(v >= 14){ v= 0; } }; console.timeEnd('click handler'); // STOP PROFILE AFTER TIME END if (withProfiling.checked) { console.profileEnd(); } });
here is a tester that could trace it in more detail: http://embed.plnkr.co/bdreL4UVFyyWtDoNTXRs/
I delete the original profiler by code because I found that this strange behavior is restored better by manually running the profiles.
to restore it, select βGet Javascript CPU Profileβ from DevTools profiles in Chrome.
Hope this was helpful
Menachem
source share