セレクター

JavaScript performance comparison

Test case created by ahomegane

Preparation code

<script src="http://mock002.ahomegane.com/common/scripts/ijs.js">
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div class="areaA">
  <p class="areaA1">
    A1
  </p>
  <p class="areaA2">
    A2
  </p>
  <p class="areaA3">
    A3
  </p>
  <p class="areaA4">
    A4
  </p>
</div>
<div class="areaB">
  <p class="areaB1">
    B1
  </p>
  <p class="areaB2">
    B2
  </p>
  <p class="areaB3">
    B3
  </p>
  <p class="areaB4">
    B4
  </p>
</div>
<div class="areaC">
  <p class="areaC1">
    C1
  </p>
  <p class="areaC2">
    C2
  </p>
  <p class="areaC3">
    C3
  </p>
  <p class="areaC4">
    C4
  </p>
</div>
<div class="areaD">
  <p class="areaD1">
    D1
  </p>
  <p class="areaD2">
    D2
  </p>
  <p class="areaD3">
    D3
  </p>
  <p class="areaD4">
    D4
  </p>
</div>
<div class="areaE">
  <p class="areaE1">
    E1
  </p>
  <p class="areaE2">
    E2
  </p>
  <p class="areaE3">
    E3
  </p>
  <p class="areaE4">
    E4
  </p>
</div>
<div class="areaF">
  <p class="areaF1">
    F1
  </p>
  <p class="areaF2">
    F2
  </p>
  <p class="areaF3">
    F3
  </p>
  <p class="areaF4">
    F4
  </p>
</div>
<div class="areaG">
  <p class="areaG1">
    G1
  </p>
  <p class="areaG2">
    G2
  </p>
  <p class="areaG3">
    G3
  </p>
  <p class="areaG4">
    G4
  </p>
</div>
<div class="areaH">
  <p class="areaH1">
    H1
  </p>
  <p class="areaH2">
    H2
  </p>
  <p class="areaH3">
    H3
  </p>
  <p class="areaH4">
    H4
  </p>
</div>

Preparation code output

A1

A2

A3

A4

B1

B2

B3

B4

C1

C2

C3

C4

D1

D2

D3

D4

E1

E2

E3

E4

F1

F2

F3

F4

G1

G2

G3

G4

H1

H2

H3

H4

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
jQuery
$('.areaG .areaG2');
pending…
Naitive
document.querySelectorAll('.areaG .areaG2');
pending…
iJs
ij('.areaG .areaG2');
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