.one vs .all

JavaScript performance comparison

Test case created

Preparation code

<div class="foobar">
  <div class="foobar1">
    <div class="foobar2">
      <div class="foobar3">
      </div>
    </div>
  </div>
</div>
<script src="http://yui.yahooapis.com/3.8.1/build/yui/yui-min.js">
</script>
<script>
  YUI().use("node", function(Y) {
    window.Y = Y;
  });
</script>

Preparation code output

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
.one
if (Y.one(".foobar3")) {
  Y.one(".foobar3").addClass("bazfoo");
}
pending…
.all
Y.all(".foobar3").addClass("bazfoo");
pending…

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

Compare results of other browsers

0 comments

Add a comment