Use of this in global scope

Benchmark created by Artif3x on


Description

Testing whether performance is a possible reason that Resharper marks the use of the this keyword in global scope as a warning.

Setup

window.myFn = function () {
       return 1 + 1;
    };

Test runner

Ready to run.

Testing in
TestOps/sec
normal function call
(function () { myFn(); }).call(window);
ready
use of this in global
(function () { this.myFn(); }).call(window);
ready

Revisions

You can edit these tests or add more tests to this page by appending /edit to the URL.

  • Revision 1: published by Artif3x on