window vs global var

JavaScript performance comparison

Test case created by Marek

Info

Check the performance of window.variable = {} vs var variable = {} in global context

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
window, undeclared
(function(){
var MR = window.MR || {};
})();
pending…
no window, undeclared
(function(){
var MR = MR || {};
})();
pending…
window, delcared
MR = {};
(function(){
var MR = window.MR || {};
})();
pending…
no-window, declared
MR = {};
(function(){
var MR = MR || {};
})();
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment