HTML Preparation code:
x
 
1
<!doctype html>
2
3
<html lang="en">
4
<head>
5
  <meta charset="utf-8">
6
  <meta name="viewport" content="width=device-width, initial-scale=1">
7
8
  <title>A Basic HTML5 Template</title>
9
  <meta name="description" content="A simple HTML5 Template for new projects.">
10
  <meta name="author" content="SitePoint">
11
12
  <meta property="og:title" content="A Basic HTML5 Template">
13
  <meta property="og:type" content="website">
14
  <meta property="og:url" content="https://www.sitepoint.com/a-basic-html5-template/">
15
  <meta property="og:description" content="A simple HTML5 Template for new projects.">
16
  <meta property="og:image" content="image.png">
17
18
  <link rel="icon" href="/favicon.ico">
19
  <link rel="icon" href="/favicon.svg" type="image/svg+xml">
20
  <link rel="apple-touch-icon" href="/apple-touch-icon.png">
21
22
  <link rel="stylesheet" href="css/styles.css?v=1.0">
23
24
</head>
25
26
<body>
27
  <!-- your content here... -->
28
  <script src="js/scripts.js"></script>
29
</body>
30
</html>
31
Tests:
  • document.body

     
    document.body
  • querySelector

     
    document.querySelector('body')
  • getElementsByTagName

     
     document.getElementsByTagName('body')[0]
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    document.body
    querySelector
    getElementsByTagName

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: one year ago)
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/115.0.0.0 Safari/537.36 Edg/115.0.1901.183
Chrome 115 on Windows
View result in a separate tab
Test name Executions per second
document.body 1621233.2 Ops/sec
querySelector 1150332.8 Ops/sec
getElementsByTagName 1051709.2 Ops/sec