feat(benchmark): make view cache a parameter to the tree benchmark

This commit is contained in:
Tobias Bosch
2015-04-10 13:23:34 -07:00
parent e34146fc14
commit 6ce085a21a
6 changed files with 36 additions and 13 deletions

View File

@ -7,6 +7,14 @@
Depth:
<input type="number" name="depth" placeholder="depth" value="9">
<br>
Use Viewcache:
<label>
Yes<input type="radio" name="viewcache" placeholder="use viewcache" value="true" checked="checked">
</label>
<label>
No<input type="radio" name="viewcache" placeholder="use viewcache" value="false">
</label>
<br>
<button>Apply</button>
</form>

View File

@ -24,7 +24,7 @@ import {ReflectionCapabilities} from 'angular2/src/reflection/reflection_capabil
import {DOM} from 'angular2/src/dom/dom_adapter';
import {isPresent} from 'angular2/src/facade/lang';
import {window, document, gc} from 'angular2/src/facade/browser';
import {getIntParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
import {getIntParameter, getStringParameter, bindAction} from 'angular2/src/test_lib/benchmark_util';
import {XHR} from 'angular2/src/services/xhr';
import {XHRImpl} from 'angular2/src/services/xhr_impl';
@ -42,7 +42,11 @@ import * as rvf from 'angular2/src/render/dom/view/view_factory';
import {Inject, bind} from 'angular2/di';
function createBindings():List {
return [bind(VIEW_POOL_CAPACITY).toValue(100000)];
var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 1;
return [
bind(rvf.VIEW_POOL_CAPACITY).toValue(viewCacheCapacity),
bind(VIEW_POOL_CAPACITY).toValue(viewCacheCapacity)
];
}
function setupReflector() {