stringify-vs-concat

Benchmark created on


Preparation HTML

<div id='x'>
</div>

Setup

gtwyName = 'b', gtwyIP = 'http://0.0.0.0', gtwyPort = '8000'
    x = document.getElementById('x');
    x.innerHTML = "<table id='a'><tr><td>0</td><td>1</td></tr><tr><td>2</td><td>3</td></tr><tr><td>4</td><td>5</td></tr><tr><td>6</td><td>7</td></tr><tr><td>8</td><td>9</td></tr><tr><td>A</td><td>B</td></tr><tr><td>C</td><td>D</td></tr><tr><td>E</td><td>F</td></tr></table>";
    t = document.getElementById('a');
    r = t.rows;
    ss = t.firstChild;
    rr = ss.firstChild;
    sss = t.firstElementChild;
    rrr = sss.firstElementChild;

Test runner

Ready to run.

Testing in
TestOps/sec
deleteRow
while (r.length != 0) {
  t.deleteRow(0);
}
ready
removeFirstChild
while (t.firstChild) {
  t.removeChild(t.firstChild);
}
ready
removeFirstElementChild
while (t.firstElementChild) {
  t.removeChild(t.firstElementChild);
}
ready
deleteRow (not hdr)
while (r.length != 1) {
  t.deleteRow(1);
}
ready
removeNextSibling
while (rr.nextSibling) { ss.removeChild(rr.nextSibling); }
ready
removeNextElementSibling
while (rrr.nextElementSibling) { sss.removeChild(rrr.nextElementSibling); }
ready

Revisions

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