jQuery DOM additions

Benchmark created by Joshua T Kalis on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>

Test runner

Ready to run.

Testing in
TestOps/sec
using setters
$("<span>")
  .addClass("msg")
  .attr("id", "greeting")
  .html("hello world.");
ready
using object for attributes
$("<span>", {
  class: "msg"
  ,id: "greeting"
  ,text: "hello world."
});
ready

Revisions

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

  • Revision 1: published by Joshua T Kalis on