jQuery create markup (v4)

Revision 4 of this benchmark created by Aurelio De Rosa on


Description

Benchmark to test what's the fastest way to create a new element in jQuery. The test compare 3 cases:

  • Passing only the opening tag
  • Passing the opening and closing tag
  • Passing an empty tag

Preparation HTML

<script src="https://code.jquery.com/jquery-1.11.1.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
$('<div>')
$('<div>')
ready
$('<div></div>')
$('<div></div>')
ready
$('<div />')
$('<div />')
ready

Revisions

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