From f6b5965a6377e2e539df2081209e8e44471f402d Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Tue, 7 Feb 2017 10:37:16 -0800 Subject: [PATCH] =?UTF-8?q?fix(benchmarks):=20don=E2=80=99t=20force=20gc?= =?UTF-8?q?=20on=20the=20`profile`=20buttons=20(#14345)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This causes v8 to depotimize functions permanently in same cases. --- modules/benchmarks/src/util.ts | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/modules/benchmarks/src/util.ts b/modules/benchmarks/src/util.ts index 15209bb3d9..ec5c41bed5 100644 --- a/modules/benchmarks/src/util.ts +++ b/modules/benchmarks/src/util.ts @@ -41,22 +41,9 @@ export function bindAction(selector: string, callback: () => void) { export function profile(create: () => void, destroy: () => void, name: string) { return function() { - window.console.profile(name + ' w GC'); + window.console.profile(name); let duration = 0; let count = 0; - while (count++ < 150) { - (window)['gc'](); - const start = window.performance.now(); - create(); - duration += window.performance.now() - start; - destroy(); - } - window.console.profileEnd(); - window.console.log(`Iterations: ${count}; time: ${duration / count} ms / iteration`); - - window.console.profile(name + ' w/o GC'); - duration = 0; - count = 0; while (count++ < 150) { const start = window.performance.now(); create();