Script Preparation code:
x
 
    var Document = function(Config) {
      this.config = {
        worker: true,
        width: "auto",
        height: "auto",
        format: "default",
        quality: "default"
      };
      this.init(Config);
    };
    Document.prototype.init = function(Config) {
      if(typeof Config == "object") {
        for(prop in Config) {
          if(this.config.hasOwnProperty(prop))
            this.config[prop] = Config[prop];
        }
      }
    };
    var Document2 = function(Config) {
      this.config = {
        worker: true,
        width: "auto",
        height: "auto",
        format: "default",
        quality: "default"
      };
      this.init(Config);
    };
    Document2.prototype.init = function(Config) {
      var keys = Object.keys(Config);
      for(var i = 0; i < keys.length; i++)
          if(this.config[keys[i]]) this.config[keys[i]] = Config[keys[i]];
    };
Tests:
  • doc1

     
    var preview = new Document({width: 50, height: 50});
  • doc2

     
    var preview = new Document2({width: 50, height: 50});
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    doc1
    doc2

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.116 Safari/537.36
Chrome 53 on Windows
View result in a separate tab
Test name Executions per second
doc1 440683.2 Ops/sec
doc2 1688912.2 Ops/sec