Title

Benchmark created by Krinkle on


Preparation HTML

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script>
  var name = 'name',
      value = 'value',
      test1 = test2 = test3 = null;
</script>

Test runner

Ready to run.

Testing in
TestOps/sec
Bad
test1 = $('<input type="hidden" />').attr({
 'name': name,
 'value': value
})
ready
Goood
test2 = $('<input/>').attr({
 'type': 'hidden',
 'name': name,
 'value': value
})
ready
alt
test3 = $('<input/>', {
 'type': 'hidden',
 'name': name,
 'value': value
})
ready

Revisions

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