ajile: Path Resolution Speed

JavaScript performance comparison

Test case created by Mike Lee

Info

Intended to compare how quickly each ajile version resolves paths from module names but technical difficulties loading ajile before the tests is blocking progress :-(

Preparation code

<script type="text/javascript">

versions =
[  "src"
,  "1.2.1"
,  "0.9.9.2" //, "0.9.9.1", "0.9.9", "0.9.8",  "0.9.5", "0.9"
,  "0.7.9"   //, "0.7.8", "0.7.6"
,  "0.5.5"
];

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

   version      = versions.pop();
   version      = version ? ("."+version+".") : ".";
   var lib      = ajile.map [version];
   script.src   = ajile [lib || "net"]
                + ajile.space + version + ajile.config
                ;
   document.lastChild.firstChild.appendChild (script);
}

ajile.map =
{  ".src."  : "github"
,  ".1.2.1.": "github"
};

ajile.github = "https://raw.github.com/iskitz/ajile/master/lib/ajile/";
ajile.net    = "//ajile.net/lib/ajile/";
ajile.space  = "com.iskitz.ajile";
ajile.config = "js?debugoff,mvcoff,mvcshareoff";

ajile.cleanup = function cleanup() {
   Ajile.Unload ("a.deeply.nested.non-existent.module");
   Ajile.Unload ();
   document.lastChild.firstChild.removeChild (ajile.script);
   delete ajile.script;
};

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

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 1.3.7
Import ("a.deeply.nested.non-existent.module");
 
pending…
ajile 1.2.1
Import ("a.deeply.nested.non-existent.module");
 
pending…
ajile 0.9.9.2
Import ("a.deeply.nested.non-existent.module");
 
pending…
ajile 0.7.9
Import ("a.deeply.nested.non-existent.module");
 
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