Static binary component tree of depth 10, i.e. 1024 components. Current numbers for `pureScriptTime` are: JavaScript: Baseline: 27.10+-9% Ng2: 26.84+-8% Ng1: 55.30+-14% Dart: Baseline: 30.13+-4% Ng2: 45.94+-3% Ng1: 128.88+-10% I.e. in JS we are same speed as baseline right now! Some background: We had a recent change in the compiler that merges components into their parents already during compilation (#2529). This made Ng2 2x faster in this benchmark (before the Ng2 JS time was 49.59+-14%ms). Closes #3196
		
			
				
	
	
		
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			55 lines
		
	
	
		
			1.6 KiB
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
import {runClickBenchmark, verifyNoBrowserErrors} from 'angular2/src/test_lib/perf_util';
 | 
						|
 | 
						|
describe('ng2 static tree benchmark', function() {
 | 
						|
 | 
						|
  var URL = 'benchmarks/src/static_tree/tree_benchmark.html';
 | 
						|
 | 
						|
  afterEach(verifyNoBrowserErrors);
 | 
						|
 | 
						|
  it('should log the ng stats with viewcache', function(done) {
 | 
						|
    runClickBenchmark({
 | 
						|
      url: URL,
 | 
						|
      buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
 | 
						|
      id: 'ng2.static.tree.create.viewcache',
 | 
						|
      params: [{name: 'viewcache', value: 'true'}]
 | 
						|
    }).then(done, done.fail);
 | 
						|
  });
 | 
						|
 | 
						|
  it('should log the ng stats without viewcache', function(done) {
 | 
						|
    runClickBenchmark({
 | 
						|
      url: URL,
 | 
						|
      buttons: ['#ng2DestroyDom', '#ng2CreateDom'],
 | 
						|
      id: 'ng2.static.tree.create.plain',
 | 
						|
      params: [{name: 'viewcache', value: 'false'}]
 | 
						|
    }).then(done, done.fail);
 | 
						|
  });
 | 
						|
 | 
						|
  it('should log the ng stats (update)', function(done) {
 | 
						|
    runClickBenchmark({
 | 
						|
      url: URL,
 | 
						|
      buttons: ['#ng2CreateDom'],
 | 
						|
      id: 'ng2.static.tree.update',
 | 
						|
      params: [{name: 'viewcache', value: 'true'}]
 | 
						|
    }).then(done, done.fail);
 | 
						|
  });
 | 
						|
 | 
						|
  it('should log the baseline stats', function(done) {
 | 
						|
    runClickBenchmark({
 | 
						|
      url: URL,
 | 
						|
      buttons: ['#baselineDestroyDom', '#baselineCreateDom'],
 | 
						|
      id: 'baseline.tree.create',
 | 
						|
      params: [{name: 'depth', value: 9, scale: 'log2'}]
 | 
						|
    }).then(done, done.fail);
 | 
						|
  });
 | 
						|
 | 
						|
  it('should log the baseline stats (update)', function(done) {
 | 
						|
    runClickBenchmark({
 | 
						|
      url: URL,
 | 
						|
      buttons: ['#baselineCreateDom'],
 | 
						|
      id: 'baseline.tree.update',
 | 
						|
      params: [{name: 'depth', value: 9, scale: 'log2'}]
 | 
						|
    }).then(done, done.fail);
 | 
						|
  });
 | 
						|
 | 
						|
});
 |