Input Type Radio vs Type Radio

JavaScript performance comparison

Test case created by J3QQ4-H7H2V-2HCH4-M3HK8-6M8VW

Preparation code

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

<input type=radio name="a4243">
<div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div>
<input type=radio name="a424333">
<div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-1213</div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div>v
<input type=radio name="a42413">
<input type=radio name="a4fs243">
<input type=radio name="a424dad3">
<div class="cg-77"></div><div class="cg-3"></div>
<input type=radio name="a4ddd243"><input type=radio name="aa4243">
<input type=radio name="a4243">
<input type=radio name="a42aa43">
<input type=radio name="a42aaaaaaa43"><input type=radio name="a42322s43">
      
<script>
Benchmark.prototype.setup = function() {
  var $element;

};
</script>

Preparation code output

"> <input type=radio name="a4243"> <div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div> <input type=radio name="a424333"> <div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-1213</div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div><div class="cg-3"></div>v <input type=radio name="a42413"> <input type=radio name="a4fs243"> <input type=radio name="a424dad3"> <div class="cg-77"></div><div class="cg-3"></div> <input type=radio name="a4ddd243"><input type=radio name="aa4243"> <input type=radio name="a4243"> <input type=radio name="a42aa43"> <input type=radio name="a42aaaaaaa43"><input type=radio name="a42322s43">

Test runner

Warning! For accurate results, please disable Firebug before running the tests. (Why?)

Java applet disabled.

Testing in CCBot 2.0.0 / Other 0.0.0
Test Ops/sec
Three conditions
$element = $("input[type=radio][name=a4243]");
pending…
Two conditions
$element = $("[type=radio][name=a4243]");
pending…
One condition
$element = $("[name=a4243]");
pending…
Other two conditions
$element = $("input[name=a4243]");
pending…

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

0 Comments

">
v