ajile: Path Resolution Speed Test

JavaScript performance comparison

Revision 8 of this test case created by Mike Lee

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, onLoad, onError) {
   var script   = document.createElement ("script");
   script.type  = "text/javascript";
   script.async = true;//false;

   onLoad  && (script.onload  = onLoad);
   onError && (script.onerror = onError);

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

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

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

};

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

ajile.getErrorHandler = function getAjileErrorHandler (v, g, n) {
    return function onAjileLoadError() {
        console.error ("ajile."+(version||"js")+" load error!");
        ajile[v] = n;
    };
};

ajile.getHandler = function getAjileHandler (version, global) {
    return function onAjile() {
        var Import     = global.Import
          , Namespace  = global.Namespace
          , ajile      = version ? (global.ajile [version] = {})
                                 :  global.ajile
                                 ;
        ajile.resolveNamespace = function toPath (deferred) {
            Namespace ("net", "http://ajile.net/test/");
            Import    ("net.ajile.test.speed");
            deferred.resolve();
        };
        console
            .log ("ajile."+ (version||"js") +" loaded & ready!");
    };
};//end:ajile.getHandler()

ajile.loadVersions = function loadAjileVersions (global) {
    /* Prefetch ajile scripts so they're cached to minimize the
       likelihood of network latency negatively impacting the
       test results.
    */

    var versions =
        ["0.5"  , "0.5.5"
        ,"0.6.2", "0.6.5"
        ,"0.7"  , "0.7.5", "0.7.8", "0.7.9"
        ,"0.9"  , "0.9.5", "0.9.8", "0.9.9", "0.9.9.1", "0.9.9.2"
        ,"1.1.5", "1.2.1", "1.3.8", "1.4.5"
        ,"1.5.0", "1.5.3", "1.5.5"
        ,"1.6.1", "1.6.8"
        ,"1.7.3"
        ,"1.9.3", "1.9.8", "1.9.9"
        ,"newest"
        ];

    var nada = {resolveNamespace: function noop(){}};

    for (var onAjile, v, i=versions.length; --i; ) {
        (v = versions[i]) && (v == "newest") && (v = "");
        ajile[v] = nada;
        ajile ( v
              , ajile.getHandler      (v, global)
              , ajile.getErrorHandler (v, global, nada)
              );
    }
};//end:ajile.loadVersions()

ajile.loadVersions (this);

</script>

<!--Prefetch the script used for testing namespace resolution-->
<script src="http://ajile.net/test/net.ajile.test.speed.js"></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
ajile
// async test
ajile.resolveNamespace (deferred);
pending…
ajile.0.6.5
// async test
ajile["0.6.5"].resolveNamespace (deferred);
pending…
ajile.0.7.9
// async test
ajile["0.7.9"].resolveNamespace (deferred);
pending…
ajile.0.9.9.2
// async test
ajile["0.9.9.2"].resolveNamespace (deferred);
pending…
ajile.1.1.5
// async test
ajile["1.1.5"].resolveNamespace (deferred);
pending…
ajile.1.2.1
// async test
ajile["1.2.1"].resolveNamespace (deferred);
pending…
ajile.1.3.8
// async test
ajile["1.3.8"].resolveNamespace (deferred);
pending…
ajile.1.4.5
// async test
ajile["1.4.5"].resolveNamespace (deferred);
pending…
ajile.1.5.5
// async test
ajile["1.5.5"].resolveNamespace (deferred);
pending…
ajile.1.6.8
// async test
ajile["1.6.8"].resolveNamespace (deferred);
pending…
ajile.1.7.3
// async test
ajile["1.7.3"].resolveNamespace (deferred);
pending…
ajile.1.9.9
// async test
ajile["1.9.9"].resolveNamespace (deferred);
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