after vs append jquery

Benchmark created by dan on


Preparation HTML

<div id="a"><div id="b"></div></div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

<script>
  a=$('#a')
  b=$('#b')
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
after
b.after('<div class="ccc"></div>')
ready
append
b.parent().append('<div class="ccc"></div>')
ready
without parent
a.append('<div class="ccc"></div>')
ready

Revisions

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

  • Revision 1: published by dan on