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

@ -13,7 +13,7 @@ export const VIEW_POOL_CAPACITY = 'ViewFactory.viewPoolCapacity';
@Injectable()
export class ViewFactory {
_poolCapacityPerProtoView:number;
_pooledViewsPerProtoView:Map<vieModule.ProtoView, List<viewModule.AppView>>;
_pooledViewsPerProtoView:Map<viewModule.AppProtoView, List<viewModule.AppView>>;
constructor(@Inject(VIEW_POOL_CAPACITY) poolCapacityPerProtoView) {
this._poolCapacityPerProtoView = poolCapacityPerProtoView;

View File

@ -27,7 +27,6 @@ export function main() {
describe('caching', () => {
it('should support multiple AppProtoViews', () => {
var capacity;
var pv1 = createPv();
var pv2 = createPv();
var vf = createViewFactory({ capacity: 2 });
@ -41,7 +40,6 @@ export function main() {
});
it('should reuse the newest view that has been returned', () => {
var capacity;
var pv = createPv();
var vf = createViewFactory({ capacity: 2 });
var view1 = vf.getView(pv);
@ -53,7 +51,6 @@ export function main() {
});
it('should not add views when the capacity has been reached', () => {
var capacity;
var pv = createPv();
var vf = createViewFactory({ capacity: 2 });
var view1 = vf.getView(pv);

View File

@ -29,7 +29,6 @@ export function main() {
describe('caching', () => {
it('should support multiple RenderProtoViews', () => {
var capacity;
var pv1 = createPv();
var pv2 = createPv();
var vf = createViewFactory({ capacity: 2 });
@ -43,7 +42,6 @@ export function main() {
});
it('should reuse the newest view that has been returned', () => {
var capacity;
var pv = createPv();
var vf = createViewFactory({ capacity: 2 });
var view1 = vf.getView(pv);
@ -55,7 +53,6 @@ export function main() {
});
it('should not add views when the capacity has been reached', () => {
var capacity;
var pv = createPv();
var vf = createViewFactory({ capacity: 2 });
var view1 = vf.getView(pv);