Benchmark.js

HTML

<script src="https://cdnjs.cloudflare.com/ajax/libs/benchmark/1.0.0/benchmark.min.js"></script>
<ul id='cycleResults'>

</ul>
<div id="result">

</div>
<br>
<button id="btn">
Run Tests
</button>

JavaScript

class BaseClass {
	constructor() {
		const i = this.init;
		i ? i.call(this) : void 0;
	}
}

class DerivedInstanceProperty {
	init = () => {
		this.a = "1";
		this.b = "2";
	}
}

class DerivedMethod {
	init() {
		this.a = "1";
		this.b = "2";
	}
}

function test1()
{
  var a = [];
  for(var i=0;i<100;i++) {
    a.push(new DerivedInstanceProperty());
  }
}

function test2()
{
	var a = [];
	for(var i=0;i<100;i++) {
		a.push(new DerivedMethod ());
	}
}

var cycleResults = document.getElementById('cycleResults');
var result = document.getElementById('result');
var btn = document.getElementById('btn');

// BENCHMARK ====================
btn.onclick = function runTests(){

  btn.setAttribute('disable', true);
	cycleResults.innerHTML = '';
  result.textContent = 'Tests running...';
  
  var suite = new Benchmark.Suite;

  // add tests
  suite
  .add('Instance Property', test1)
  .add('Prototype Method', test2)
  // add listeners
  .on('cycle', function(event) {
    var result = document.createElement('li');
    result.textContent = String(event.target);
    
    document.getElementById('cycleResults')
    	.appendChild(result);
  })
  .on('complete', function() {
    result.textContent = 'Fastest is ' + this.filter('fastest').pluck('name');
    btn.setAttribute('disable', false);
  })
  // run async
  .run({ 'async': true });
};