@@ -8,7 +8,7 @@ import {TemplateLoader} from 'core/compiler/template_loader';
88import { LifeCycle } from 'core/life_cycle/life_cycle' ;
99
1010import { reflector } from 'reflection/reflection' ;
11- import { DOM , document , window , Element } from 'facade/dom' ;
11+ import { DOM , document , window , Element , gc } from 'facade/dom' ;
1212import { isPresent } from 'facade/lang' ;
1313
1414var MAX_DEPTH = 9 ;
@@ -137,18 +137,29 @@ export function main() {
137137
138138 function profile ( create , destroy , name ) {
139139 return function ( _ ) {
140- window . console . profile ( name ) ;
140+ window . console . profile ( name + ' w GC' ) ;
141141 var duration = 0 ;
142- var downCount = 200 ;
143142 var count = 0 ;
144- while ( downCount -- ) {
143+ while ( count ++ < 150 ) {
144+ gc ( ) ;
145145 var start = window . performance . now ( ) ;
146146 create ( _ ) ;
147147 duration += window . performance . now ( ) - start ;
148148 destroy ( _ ) ;
149- count ++ ;
150149 }
151- window . console . profileEnd ( name ) ;
150+ window . console . profileEnd ( name + ' w GC' ) ;
151+ window . console . log ( `Iterations: ${ count } ; time: ${ duration / count } ms / iteration` ) ;
152+
153+ window . console . profile ( name + ' w/o GC' ) ;
154+ duration = 0 ;
155+ count = 0 ;
156+ while ( count ++ < 150 ) {
157+ var start = window . performance . now ( ) ;
158+ create ( _ ) ;
159+ duration += window . performance . now ( ) - start ;
160+ destroy ( _ ) ;
161+ }
162+ window . console . profileEnd ( name + ' w/o GC' ) ;
152163 window . console . log ( `Iterations: ${ count } ; time: ${ duration / count } ms / iteration` ) ;
153164 } ;
154165 }
@@ -227,6 +238,7 @@ var BASELINE_IF_TEMPLATE = DOM.createTemplate(
227238// http://jsperf.com/nextsibling-vs-childnodes
228239
229240class BaseLineTreeComponent {
241+ element :Element ;
230242 value :BaseLineInterpolation ;
231243 left :BaseLineIf ;
232244 right :BaseLineIf ;
0 commit comments