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 = {
        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];
            }
          }
        };
Rendered benchmark preparation results:

Suite status: <idle, ready to run>

Previous results

Experimental features:

  • Test case name Result
    prop not declared
    prop declared

    Fastest: N/A

    Slowest: N/A

Latest run results:
Run details: (Test run date: 6 years ago)
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36
Chrome 69 on Mac OS X 10.13.6
View result in a separate tab
Test name Executions per second
prop not declared 8284570.5 Ops/sec
prop declared 3809781.8 Ops/sec