HTML Preparation code:
AخA
 
1
<html>
2
  <head></head>
3
  <body>
4
    <script type="text/javascript">
5
        var doc = new Document({width: 50, height: 50});
6
    </script>
7
  </body>
8
</html>
Script Preparation code:
 
    var Document = function(Config) {
      this.config = {
        worker: true,
        width: "auto",
        height: "auto"
      };
      this.init(Config);
    };
Tests:
  • prop not declared

     
        Document.prototype.init = function(Config) {
          var config = this.config;
          if(typeof Config == "object") {
            for(prop in Config) {
              if(config.hasOwnProperty(prop))
                this.config[prop] = Config[prop];
            }
          }
        };
  • prop declared

     
        Document.prototype.init = function(Config) {
          var config = this.config;
          if(typeof Config == "object") {
            for(var prop in Config) {
              if(config.hasOwnProperty(prop))
                this.config[prop] = Config[prop];
            }
          }
        };
  • prop not declared without ref

     
        Document.prototype.init = function(Config) {
          if(typeof Config == "object") {
            for(prop in Config) {
              if(this.config.hasOwnProperty(prop))
                this.config[prop] = Config[prop];
            }
          }
        };
  • prop declared without ref

     
        Document.prototype.init = function(Config) {
          if(typeof Config == "object") {
            for(var prop in Config) {
              if(this.config.hasOwnProperty(prop))
                this.config[prop] = Config[prop];
            }
          }
        };
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    prop not declared
    prop declared
    prop not declared without ref
    prop declared without ref

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 8 years ago)
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:48.0) Gecko/20100101 Firefox/48.0
Firefox 48 on Windows 8.1
View result in a separate tab
Test name Executions per second
prop not declared 38738664.0 Ops/sec
prop declared 31487398.0 Ops/sec
prop not declared without ref 30435558.0 Ops/sec
prop declared without ref 27244124.0 Ops/sec