Get elements by tag name

Benchmark created by David Mark on


Description

Constructs similar high-level objects, wrapped around an array of element references

Point is that you can't match the example My Library pattern (or performance) with jQuery as jQuery has only one way to retrieve element references.

Also, jQuery is using QSA (not doing any real work) to run the query. This is a bad state of affairs as QSA is not compatible with jQuery's legacy query code (not even close). QSA also requires a lot of feature testing (which jQuery does not have) to avoid cross-browser issues.

Preparation HTML

<script src="//www.cinsoft.net/mylib099-min.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script>
  var toArray = API.toArray; // NOTE: No optimization in core toArray
  var getEBTN = API.getEBTN; // One missing link in jQuery
  var myQuery;
  var myjQuery;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
My Library
myQuery = Q(toArray(getEBTN('div')));
ready
jQuery
myjQuery = $('div');
ready

Revisions

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