Angular IsFunction x Javascipt TypeOf Function (v3)

Revision 3 of this benchmark created by sean3z on


Description

Check performance between Angular.isFunction and Typeof 'function'.

Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.14/angular.min.js">
</script>
<script>
function f(){}
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Typeof Function
for (var i = 0; i < 1000000; i++) {
  if (typeof f === 'function') {
    // do stuff
  }
}
ready
Angular.isFunction
for (var i = 0; i < 1000000; i++) {
  if (angular.isFunction(f)) {
    // do stuff
  }
}
ready

Revisions

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