Run details:
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.114 Safari/537.36
Chrome 91
Linux
Desktop
3 years ago
Test name Executions per second
Html String (append) 887469.4 Ops/sec
html string (innerHTML) 18501.6 Ops/sec
virtual node function 16513.3 Ops/sec
Clone cached vnode 124056.2 Ops/sec
vparent (append) 920964.4 Ops/sec
vparent (innerHTML) 19536.6 Ops/sec
vparent appendChild 18494.2 Ops/sec
vparent cloneNode 173939.8 Ops/sec
HTML Preparation code:
Script Preparation code:
Tests:
  • Html String (append)

  • html string (innerHTML)

  • virtual node function

  • Clone cached vnode

  • vparent (append)

  • vparent (innerHTML)

  • vparent appendChild

  • vparent cloneNode

  • Control run coz i dont believe that innerHTML is slower.

  • template string function