Skip to content

Commit f6b5965

Browse files
tboschmhevery
authored andcommitted
fix(benchmarks): don’t force gc on the profile buttons (angular#14345)
This causes v8 to depotimize functions permanently in same cases.
1 parent 7a4c255 commit f6b5965

File tree

1 file changed

+1
-14
lines changed

1 file changed

+1
-14
lines changed

modules/benchmarks/src/util.ts

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -41,22 +41,9 @@ export function bindAction(selector: string, callback: () => void) {
4141

4242
export function profile(create: () => void, destroy: () => void, name: string) {
4343
return function() {
44-
window.console.profile(name + ' w GC');
44+
window.console.profile(name);
4545
let duration = 0;
4646
let count = 0;
47-
while (count++ < 150) {
48-
(<any>window)['gc']();
49-
const start = window.performance.now();
50-
create();
51-
duration += window.performance.now() - start;
52-
destroy();
53-
}
54-
window.console.profileEnd();
55-
window.console.log(`Iterations: ${count}; time: ${duration / count} ms / iteration`);
56-
57-
window.console.profile(name + ' w/o GC');
58-
duration = 0;
59-
count = 0;
6047
while (count++ < 150) {
6148
const start = window.performance.now();
6249
create();

0 commit comments

Comments
 (0)