Fastest function definition

Benchmark created by soulcyon on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
Self
var result = (function(){
   return true;
})();
ready
Standard
function e(){
  return true;
}
var result = e();
ready
Var
var e = function(){
    return true;
};
var result = e();
ready
Call
var e = function(){
    return true;
};
var result = e.call(this);
ready
Apply
var e = function(){
    return true;
};
var result = e.apply(this);
ready

Revisions

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

  • Revision 1: published by soulcyon on
  • Revision 3: published by soulcyon on
  • Revision 4: published on