Toggle navigation
MeasureThat.net
Create a benchmark
Tools
Feedback
FAQ
Register
Log In
Run results for:
inner / outer
Go to the benchmark
Embed
Embed Benchmark Result
Run details:
User agent:
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/138.0.0.0 Safari/537.36
Browser:
Chrome 138
Operating system:
Mac OS X 10.15.7
Device Platform:
Desktop
Date tested:
10 months ago
Test name
Executions per second
outer
2324008.0 Ops/sec
inner
2117838.5 Ops/sec
HTML Preparation code:
<body> <a href="//www.yahoo.com" target="_blank">Yahoo!</a><br/> <a href="//www.altavista.com" target="_blank">AltaVista</a><br/> <a href="//www.google.com" target="_blank">Google</a><br/> </body>
Tests:
outer
(function registerHandlers() { var anchors = document.getElementsByTagName('a'); for (var i = 0; i < anchors.length; i++) { anchors[i].onclick = bla.bind(null, i); } function bla(i) { alert(i); return false; } })();
inner
(function registerHandlers() { var anchors = document.getElementsByTagName('a'); for (var i = 0; i < anchors.length; i++) { anchors[i].onclick = (function(idx) { return function() { alert(idx); return false; } })(i); } })();