angular.element vs document.querySelectorAll (v3)

Revision 3 of this benchmark created by Jibap on


Preparation HTML

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.2.0/angular.min.js"></script>
<div ng-app>
    <div id="col1" ng-controller="MyCtrl" class="group1"></div>
</div>

Setup

var MyCtrl;
    MyCtrl = function($scope) {
      $scope.gkey = 'group1';
    };
    
    function FindWithAngular() {
      return angular.element('.group1');
    }
    
    function FindWithJS() {
      return document.querySelectorAll('.group1')
    }

Test runner

Ready to run.

Testing in
TestOps/sec
angular.element
var g = FindWithAngular();
ready
document.querySelectorAll
var g = FindWithJS();
ready

Revisions

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