fix(benchmarks): don’t force gc on the `profile` buttons (#14345)

This causes v8 to depotimize functions permanently in same cases.
This commit is contained in:
Tobias Bosch 2017-02-07 10:37:16 -08:00 committed by Miško Hevery
parent 7a4c25535d
commit f6b5965a63
1 changed files with 1 additions and 14 deletions

View File

@ -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) {
(<any>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();