document.head vs getElementsByTagName (v3)

Revision 3 of this benchmark created on


Test runner

Ready to run.

Testing in
TestOps/sec
document.head
var head = document.head;
ready
getElementsByTagName
var head = document.getElementsByTagName( 'head' )[ 0 ];
ready
check
document.head || (document.head = document.getElementsByTagName('head')[0]);
ready
assign
document.head = document.head || document.getElementsByTagName('head')[0];
ready

Revisions

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

  • Revision 1: published by Andreas Goebel on
  • Revision 3: published on
  • Revision 4: published by r on
  • Revision 5: published by Konstantin Tarkus on