Eithed/RSC

JavaScript performance comparison

Revision 3 of this test case created

Preparation code

<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js">
</script>
<div class="content">
<h1>
 <span></span>TM<span></span>Ipsu<span></span>Present<span></span></h1>
<p>
  <strong>
   <span></span>ellentesqu<span></span>habitan<span></span>morb<span></span>tristiqu<span></span>  </strong>
 <span></span>enectu<span></span>e<span></span>netu<span></span>e<span></span>malesuad<span></span>fame<span></span>a<span></span>turpi<span></span>egesta<span></span><span></span>estibulu<span></span>torto<span></span>qua<span></span>
 <span></span>eugia<span></span>vita<span></span><span></span>ltricie<span></span>ege<span></span><span></span>empo<span></span>si<span></span>ame<span></span><span></span>nt<span></span><span></span>one<span></span>e<span></span>liber<span></span>si<span></span>ame<span></span>qua<span></span> <span></span>gesta<span></span>sempe<span></span>
  <em>
   <span></span>enea<span></span>ultricie<span></span>m<span></span>vita<span></span>es<span></span>
  </em>
 <span></span>auri<span></span>placera<span></span>eleifen<span></span>le<span></span><span></span>uisqu<span></span>si<span></span>ame<span></span>es<span></span>e<span></span>sapie<span></span>ullamcorpe<span></span>pharetr<span></span>
 <span></span>estibulu<span></span>era<span></span>wis<span></span><span></span>ondimentu<span></span>se<span></span>
  <code>
   <span></span>ommod<span></span>vita<span>[Button]A[/Button]</span>  </code>
  ,<span></span>rnar<span></span>si<span></span>ame<span></span><span></span>is<span></span><span></span>enea<span></span>fermentu<span></span><span></span>li<span></span>ege<span></span>tincidun<span></span>condimentu<span></span><span></span>ro<span></span> <span></span>psu<span></span>rutru<span></span>orc<span></span><span></span>agitti<span></span>tempu<span></span>lacu<span></span>eni<span></span>a<span></span>du<span></span>
  <<span></span>hre<span></span>"#">Done<span></span>no<span></span>eni<span></</span>>
 <span></span><span></span>turpi<span></span>pulvina [Button]A[/Button]<span></span>facilisi<span></span><span></span><span></span>feli<span></span>
</p>
<h2>
 <span></span>eade<span></span>Leve<span></span><span></span></h2>
<ol>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>
  </li>
</ol>
<blockquote>
  <p>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetu<span></span>adipiscin<span></span>eli<span></span><span></span>ivamu<span></span>magn<span></span><span></span>ra<span></span>i<span></span>   <span></span><span></span>a<span></span>feli<span></span>alique<span></span>congu<span></span><span></span><span></span><span></span>es<span></span>ege<span></span>ligul<span></span>molesti<span></span>gravid<span></span><span></span>urabitu<span></span>mass<span></span>
   <span></span>one<span></span>eleifen<span></span><span></span>iber<span></span>a<span></span>sagitti<span></span>molli<span></span><span></span>ellu<span></span>es<span></span>malesuad<span></span>tellu<span></span><span></span><span></span>luctu<span></span>   <span></span>urpi<span></span>eli<span></span>si<span></span>ame<span></span>qua<span></span><span></span>ivamu<span></span>pretiu<span></span>ornar<span></span>es<span></span>
  </p>
</blockquote>
<h3>
 <span></span>eade<span></span>Leve<span></span><span></span></h3>
<ul>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>
  </li>
</ul>
<pre>
  <code>
    <span></span>eade<span></span>h<span></span><span></span>{<span></span>ispla<span></span><span></span>loc<span></span><span></span>idt<span></span><span></span>00p<span></span><span></span>eigh<span></span><span></span>0p<span></span> }
  </code>
</pre>
<h1>
 <span></span>TM<span></span>Ipsu<span></span>Present<span></span></h1>
<p>
  <strong>
   <span></span>ellentesqu<span></span>habitan<span></span>morb<span></span>tristiqu<span></span>  </strong>
 <span></span>enectu<span></span>e<span></span>netu<span></span>e<span></span>malesuad<span></span>fame<span></span>a<span></span>turpi<span></span>egesta<span></span><span></span>estibulu<span></span>torto<span></span>qua<span></span>
 <span></span>eugia<span></span>vita<span></span><span></span>ltricie<span></span>ege<span></span><span></span>empo<span></span>si<span></span>ame<span></span>[Button]B[/Button]<span></span>nt<span></span><span></span>one<span></span>e<span></span>liber<span></span>si<span></span>ame<span></span>qua<span></span> <span></span>gesta<span></span>sempe<span></span>
  [Button]B[/Button]<em>
   <span></span>enea<span></span>ultricie<span></span>m<span></span>vita<span></span>es<span></span>
  </em>
 <span></span>auri<span></span>placera<span></span>eleifen<span></span>le<span></span><span></span>uisqu<span></span>si<span></span>ame<span></span>es<span></span>e<span></span>sapie<span></span>ullamcorpe<span></span>pharetr<span></span>
 <span></span>estibulu<span></span>era<span></span>wis<span></span><span></span>ondimentu<span></span>se<span></span>
  <code>
   <span></span>ommod<span></span>vita<span></span>  </code>
  ,<span></span>rnar<span></span>si<span></span>ame<span></span><span></span>is<span></span><span></span>enea<span></span>fermentu<span></span><span></span>li<span></span>ege<span></span>tincidun<span></span>condimentu<span></span><span></span>ro<span></span> <span></span>psu<span></span>rutru<span></span>orc<span></span><span></span>agitti<span></span>tempu<span></span>lacu<span></span>eni<span></span>a<span></span>du<span></span>
  <<span></span>hre<span></span>"#">Done<span></span>no<span></span>eni<span></</span>>
 <span></span><span></span>turpi<span></span>pulvina<span></span>facilisi<span></span><span></span><span></span>feli<span></span>
</p>
<h2>
 <span></span>eade<span></span>Leve<span></span><span></span></h2>
<ol>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>
  </li>
</ol>
<blockquote>
  <p>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetu<span></span>adipiscin<span></span>eli<span></span><span></span>ivamu<span></span>magn<span></span><span></span>ra<span></span>i<span></span>   <span></span><span></span>a<span></span>feli<span></span>alique<span></span>congu<span></span><span></span><span></span><span></span>es<span></span>ege<span></span>ligul<span></span>molesti<span></span>gravid<span></span><span></span>urabitu<span></span>mass<span></span>
   <span></span>one<span></span>eleifen<span></span><span></span>iber<span></span>a<span></span>sagitti<span></span>molli<span></span><span></span>ellu<span></span>es<span></span>malesuad<span></span>tellu<span></span><span></span><span></span>luctu<span></span>  [Button]C[/Button] <span></span>urpi<span></span>eli<span></span>si<span></span>ame<span></span>qua<span></span><span></span>ivamu<span></span>pretiu<span></span>ornar<span></span>es<span></span>
  </p>
</blockquote>
<h3>
 <span></span>eade<span></span>Leve<span></span><span></span></h3>
<ul>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>
  </li>
</ul>
<pre>
  <code>
    <span></span>eade<span></span>h<span></span><span></span>{<span></span>ispla<span></span><span></span>loc<span></span><span></span>idt<span></span><span></span>00p<span></span><span></span>eigh<span></span><span></span>0p<span></span> }
  </code>
</pre>
<h1>
 <span></span>TM<span></span>Ipsu<span></span>Present<span></span></h1>
<p>
  <strong>
   <span></span>ellentesqu<span></span>habitan<span></span>morb<span></span>tristiqu<span></span>  </strong>
 <span></span>enectu<span></span>e<span></span>netu<span></span>e<span></span>malesuad<span></span>fame<span></span>a<span></span>turpi<span></span>egesta<span></span><span></span>estibulu<span></span>torto<span></span>qua<span></span>
 <span></span>eugia<span></span>vita<span></span><span></span>ltricie<span></span>ege<span></span><span></span>empo<span></span>si<span></span>ame<span></span><span></span>nt<span></span><span></span>one<span></span>e<span></span>liber<span></span>si<span></span>ame<span></span>qua<span></span> <span></span>gesta<span></span>sempe<span></span>
  <em>
   <span></span>enea<span></span>ultricie<span></span>m<span></span>vita<span></span>es<span></span>
  </em>[Button]C[/Button]
 <span></span>auri<span></span>placera<span></span>eleifen<span></span>le<span></span><span></span>uisqu<span></span>si<span></span>ame<span></span>es<span></span>e<span></span>sapie<span></span>ullamcorpe<span></span>pharetr<span></span>
 <span></span>estibulu<span></span>era<span></span>wis<span></span><span></span>ondimentu<span></span>se<span></span>
  <code>
   <span></span>ommod<span></span>vita<span></span>  </code>
  ,<span></span>rnar<span></span>si<span></span>ame<span></span><span></span>is<span></span><span></span>enea<span></span>fermentu<span></span><span></span>li<span></span>ege<span></span>tincidun<span></span>condimentu<span></span><span></span>ro<span></span> <span></span>psu<span></span>rutru<span></span>orc<span></span><span></span>agitti<span></span>tempu<span></span>lacu<span></span>eni<span></span>a<span></span>du<span></span>
  <<span></span>hre<span></span>"#">Done<span></span>no<span></span>eni<span></</span>>
 <span></span><span></span>turpi<span></span>pulvina<span></span>facilisi<span></span><span></span><span></span>feli<span></span>
</p>
<h2>
 <span></span>eade<span></span>Leve<span></span><span></span></h2>
<ol>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>
  </li>
</ol>
<blockquote>
  <p>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetu<span></span>adipiscin<span></span>eli<span></span><span></span>ivamu<span></span>magn<span></span><span></span>ra<span></span>i<span></span>   <span></span><span></span>a<span></span>feli<span></span>alique<span></span>congu<span></span><span></span><span></span><span></span>es<span></span>ege<span></span>ligul<span></span>molesti<span></span>gravid<span></span>
   <span></span>urabitu<span></span>mass<span></span><span></span>one<span></span>eleifen<span></span><span></span>iber<span></span>a<span></span>sagitti<span></span>molli<span></span><span></span>ellu<span></span>es<span></span>malesuad<span></span>   <span></span>ellu<span></span><span></span><span></span>luctu<span></span>turpi<span></span>eli<span></span>si<span></span>ame<span></span>qua<span></span><span></span>ivamu<span></span>pretiu<span></span>ornar<span></span>es<span></span>
  </p>
</blockquote>
<h3>
 <span></span>eade<span></span>Leve<span></span><span></span></h3>
<ul>
  <li>
   <span></span>ore<span></span>ipsu<span></span>dolo<span></span>si<span></span>ame<span></span><span></span>onsectetue<span></span>adipiscin<span></span>eli<span></span>
  </li>
  <li>
   <span></span>liqua<span></span>tincidun<span></span>mauri<span></span>e<span></span>risu<span></span>[Butto<span>]</span>
  </li>
</ul>
</div>

Preparation code output

TMIpsuPresent

ellentesquhabitanmorbtristiqu enectuenetuemalesuadfameaturpiegestaestibulutortoqua eugiavitaltricieegeemposiamentoneelibersiamequa gestasempe eneaultriciemvitaes auriplaceraeleifenleuisqusiameesesapieullamcorpepharetr estibuluerawisondimentuse ommodvita[Button]A[/Button] ,rnarsiameiseneafermentuliegetinciduncondimenturo psurutruorcagittitempulacueniadu <hre"#">Donenoeni> turpipulvina [Button]A[/Button]facilisifeli

eadeLeve

  1. oreipsudolosiameonsectetueadipiscineli
  2. liquatincidunmaurierisu

oreipsudolosiameonsectetuadipiscineliivamumagnrai afelialiqueconguesegeligulmolestigravidurabitumass oneeleifeniberasagittimollielluesmalesuadtelluluctu urpielisiamequaivamupretiuornares

eadeLeve

  • oreipsudolosiameonsectetueadipiscineli
  • liquatincidunmaurierisu
  
    eadeh{isplalocidt00peigh0p }
  

TMIpsuPresent

ellentesquhabitanmorbtristiqu enectuenetuemalesuadfameaturpiegestaestibulutortoqua eugiavitaltricieegeemposiame[Button]B[/Button]ntoneelibersiamequa gestasempe [Button]B[/Button] eneaultriciemvitaes auriplaceraeleifenleuisqusiameesesapieullamcorpepharetr estibuluerawisondimentuse ommodvita ,rnarsiameiseneafermentuliegetinciduncondimenturo psurutruorcagittitempulacueniadu <hre"#">Donenoeni> turpipulvinafacilisifeli

eadeLeve

  1. oreipsudolosiameonsectetueadipiscineli
  2. liquatincidunmaurierisu

oreipsudolosiameonsectetuadipiscineliivamumagnrai afelialiqueconguesegeligulmolestigravidurabitumass oneeleifeniberasagittimollielluesmalesuadtelluluctu [Button]C[/Button] urpielisiamequaivamupretiuornares

eadeLeve

  • oreipsudolosiameonsectetueadipiscineli
  • liquatincidunmaurierisu
  
    eadeh{isplalocidt00peigh0p }
  

TMIpsuPresent

ellentesquhabitanmorbtristiqu enectuenetuemalesuadfameaturpiegestaestibulutortoqua eugiavitaltricieegeemposiamentoneelibersiamequa gestasempe eneaultriciemvitaes [Button]C[/Button] auriplaceraeleifenleuisqusiameesesapieullamcorpepharetr estibuluerawisondimentuse ommodvita ,rnarsiameiseneafermentuliegetinciduncondimenturo psurutruorcagittitempulacueniadu <hre"#">Donenoeni> turpipulvinafacilisifeli

eadeLeve

  1. oreipsudolosiameonsectetueadipiscineli
  2. liquatincidunmaurierisu

oreipsudolosiameonsectetuadipiscineliivamumagnrai afelialiqueconguesegeligulmolestigravid urabitumassoneeleifeniberasagittimollielluesmalesuad elluluctuturpielisiamequaivamupretiuornares

eadeLeve

  • oreipsudolosiameonsectetueadipiscineli
  • liquatincidunmaurierisu[Butto]

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
Search
$(document).ready(function() {

  $(".content").find(":contains([Button])").each(function() {
    if (!$(this).is("script")) $(this).contents().each(function() {
      if ($(this).get(0).nodeType == 3 && $(this).get(0).nodeValue.indexOf("[Button]") != -1 && $(this).get(0).nodeValue.indexOf("[/Button]") != -1) {
        var _new = $(this).get(0).nodeValue.replace(/\[Button\](.*?)\[\/Button\]/gi, function(stmt, value) {
          return "<a class='button'>" + value + "</a>";
        });
        $(this).before(_new).remove();
      }
    });
  });
});
pending…
Replace
$(document).ready(function() {
  var buttonReplaced = $(".content").html().replace(/\[Button\]/ig, '<a class="button">').replace(/\[\/Button\]/ig, '</a>');
  $(".content").html(buttonReplaced);
});
pending…

Compare results of other browsers

Revisions

You can edit these tests or add even more tests to this page by appending /edit to the URL. Here’s a list of current revisions for this page:

0 comments

Add a comment