ajile: Path Resolution Speed Test

JavaScript performance comparison

Revision 4 of this test case created by Mike Lee and last updated

Info

Tests how quickly each ajile version converts a multi-level namespace into a file path or URL.

Preparation code

<script type="text/javascript">

function ajile (version) {
   var script   = document.createElement ("script");
   script.type  = "text/javascript";
   script.async = false;
   ajile.script = script;

   version      = version ? ("."+version+".") : ".";
   var host     = ajile.host [version];

   script.src   = ajile [host || "site"]
                + ajile.space + version + ajile.config
                ;
   document.lastChild.firstChild.appendChild (script);
}

ajile.cleanup = function unloadAjile () {
   var version = Ajile.GetVersion();
   try {
       Ajile.Unload ();
   }
   catch (e) {
      delete this.Ajile;
      delete com.iskitz.ajile;

      ajile.script
      && (ajile.script.parentNode==document.lastChild.firstChild)
      && document.lastChild.firstChild.removeChild(ajile.script);

      console.log ("Ajile.Unload() failed for ajile"+version+": "+e+"\n\n");
   }
   delete ajile.script;
};

ajile.host =
{/*""      : "github"
,  ".src." : "github"
,*/

};

ajile.project   = "https://raw.github.com/iskitz/ajile/master/lib/ajile/";
ajile.site     = "//ajile.net/use/";
ajile.space    = "com.iskitz.ajile";
ajile.config   = "js?cloakoff,mvcoff,mvcshareoff,override";

ajile.resolvePath = function testPathResolutionSpeed (deferred, version) {
  ajile (version);

  var thread = setInterval (function isAjileLoaded() {
     if (!(this.Ajile && this.Import)) return;

     Namespace ("net", "//ajile.net/test/");
     Import ("net.ajile.test.speed");
     deferred.resolve();
     clearInterval (thread);
     clearTimeout  (safety);
  },0);

  var safety = setTimeout (function abortTest() {
     clearInterval (thread);
     clearTimeout  (safety);
     deferred.resolve();
     if (!this.Ajile) {
        throw new Error ("Unable to load ajile"+ version);
     }
  }, 5000);
};

</script>
<script>
Benchmark.prototype.teardown = function() {
    ajile.cleanup();
   
};
</script>

Test runner

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

Java applet disabled.

Testing in unknown unknown
Test Ops/sec
ajile
// async test
ajile.resolvePath (deferred);
pending…
ajile 1.5.3
// async test
ajile.resolvePath (deferred, "1.5.3");
pending…
ajile 1.4.5
// async test
ajile.resolvePath (deferred, "1.4.5");
pending…
ajile 1.3.8
// async test
ajile.resolvePath (deferred, "1.3.8");
pending…
ajile 1.2.1
// async test
ajile.resolvePath (deferred, "1.2.1");
pending…
ajile 1.1.5
// async test
ajile.resolvePath (deferred, "1.1.5");
pending…
ajile 0.9.9.2
// async test
ajile.resolvePath (deferred, "0.9.9.2");
pending…
ajile 0.7.9
// async test
ajile.resolvePath (deferred, "0.7.9");
pending…
ajile 0.6.5
// async test
ajile.resolvePath (deferred, "0.6.5");
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