refactor(benchmark): add view cache param to largetable benchmarks

This commit is contained in:
Tobias Bosch
2015-06-09 15:00:49 -07:00
parent 5ab92ce844
commit d07ed581a9
3 changed files with 28 additions and 1 deletions

View File

@ -9,6 +9,16 @@
<div>
<form>
<div>
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>
</div>
<div>
rows:
<input type="number" name="rows" value="100">

View File

@ -16,6 +16,7 @@ import {
import {NgFor, NgSwitch, NgSwitchWhen, NgSwitchDefault} from 'angular2/directives';
import {BrowserDomAdapter} from 'angular2/src/dom/browser_adapter';
import {APP_VIEW_POOL_CAPACITY} from 'angular2/src/core/compiler/view_pool';
import {ListWrapper} from 'angular2/src/facade/collection';
@ -27,11 +28,13 @@ export const LARGETABLE_ROWS = 'LargetableComponent.rows';
export const LARGETABLE_COLS = 'LargetableComponent.cols';
function _createBindings() {
var viewCacheCapacity = getStringParameter('viewcache') == 'true' ? 10000 : 1;
return [
bind(BENCHMARK_TYPE)
.toValue(getStringParameter('benchmarkType')),
bind(LARGETABLE_ROWS).toValue(getIntParameter('rows')),
bind(LARGETABLE_COLS).toValue(getIntParameter('columns'))
bind(LARGETABLE_COLS).toValue(getIntParameter('columns')),
bind(APP_VIEW_POOL_CAPACITY).toValue(viewCacheCapacity)
];
}