Test case name | Result |
---|---|
With createElement() and append() | |
With createElement() and appendChild() | |
With innerHTML and getElementById() | |
With innerHTML and getElementsByClassName() | |
With innerHTML and getElementsByTagName() | |
With innerHTML and querySelector() | |
With innerHTML and querySelectorAll() | |
With createElement() and outerHTML | |
With innerHTML and children[children.length - 1] | |
With innerHTML and lastChild | |
With innerHTML and lastElementChild | |
With createElement() and innerHTML |
Test name | Executions per second |
---|---|
With createElement() and append() | 701.9 Ops/sec |
With createElement() and appendChild() | 252.4 Ops/sec |
With innerHTML and getElementById() | 542786.3 Ops/sec |
With innerHTML and getElementsByClassName() | 476435.9 Ops/sec |
With innerHTML and getElementsByTagName() | 453142.8 Ops/sec |
With innerHTML and querySelector() | 462701.3 Ops/sec |
With innerHTML and querySelectorAll() | 387011.9 Ops/sec |
With createElement() and outerHTML | 330630.1 Ops/sec |
With innerHTML and children[children.length - 1] | 414557.2 Ops/sec |
With innerHTML and lastChild | 520841.1 Ops/sec |
With innerHTML and lastElementChild | 524433.1 Ops/sec |
With createElement() and innerHTML | 394358.5 Ops/sec |