values-loop-test

JavaScript performance comparison

Test case created

Preparation code

 
<script>
Benchmark.prototype.setup = function() {
    var getValues = function(obj) {
        return Object.keys(obj).map(function(key) {
                return obj[key];
        });
    };
   
    var json = {
      "configGlossary:installationAt": "Philadelphia, PA",
      "configGlossary:adminEmail": "ksm@pobox.com",
      "configGlossary:poweredBy": "Cofax",
      "configGlossary:poweredByIcon": "/images/cofax.gif",
      "configGlossary:staticPath": "/content/static",
      "templateProcessorClass": "org.cofax.WysiwygTemplate",
      "templateLoaderClass": "org.cofax.FilesTemplateLoader",
      "templatePath": "templates",
      "templateOverridePath": "",
      "defaultListTemplate": "listTemplate.htm",
      "defaultFileTemplate": "articleTemplate.htm",
      "useJSP": false,
      "jspListTemplate": "listTemplate.jsp",
      "jspFileTemplate": "articleTemplate.jsp",
      "cachePackageTagsTrack": 200,
      "cachePackageTagsStore": 200,
      "cachePackageTagsRefresh": 60,
      "cacheTemplatesTrack": 100,
      "cacheTemplatesStore": 50,
      "cacheTemplatesRefresh": 15,
      "cachePagesTrack": 200,
      "cachePagesStore": 100,
      "cachePagesRefresh": 10,
      "cachePagesDirtyRead": 10,
      "searchEngineListTemplate": "forSearchEnginesList.htm",
      "searchEngineFileTemplate": "forSearchEngines.htm",
      "searchEngineRobotsDb": "WEB-INF/robots.db",
      "useDataStore": true,
      "dataStoreClass": "org.cofax.SqlDataStore",
      "redirectionClass": "org.cofax.SqlRedirection",
      "dataStoreName": "cofax",
      "dataStoreDriver": "com.microsoft.jdbc.sqlserver.SQLServerDriver",
      "dataStoreUrl": "jdbc:microsoft:sqlserver://LOCALHOST:1433",
      "dataStoreUser": "sa",
      "dataStorePassword": "dataStoreTestQuery",
      "dataStoreTestQuery": "SET NOCOUNT ON;select test='test';",
      "dataStoreLogFile": "/usr/local/tomcat/logs/datastore.log",
      "dataStoreInitConns": 10,
      "dataStoreMaxConns": 100,
      "dataStoreConnUsageLimit": 100,
      "dataStoreLogLevel": "debug",
      "maxUrlLength": 500
    };
};
</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
Values
getValues(json).filter(function(item) {
    return (typeof item === 'string');
});
pending…
Loop
var current, all = [];

for (var i in json) {
    if (json.hasOwnProperty(i)) {
        current = json[i];
        if (typeof current === 'string') {
            all.push(current);
        }
    }
}
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