Skip to content

Commit 697e0ef

Browse files
divdavemmilomg
authored andcommitted
replace window.gc by globalThis.gc
1 parent 0a083e2 commit 697e0ef

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

src/benches/sBench.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ export function sbench(framework: ReactiveFramework, logPerfResult: PerfResultCa
5050
let end = 0;
5151

5252
framework.withBuild(() => {
53-
if (window.gc) gc!(), gc!();
53+
if (globalThis.gc) gc!(), gc!();
5454

5555
// run 3 times to warm up
5656
let sources: Computed<number>[] | null = createDataSignals(scount, []);
@@ -67,15 +67,15 @@ export function sbench(framework: ReactiveFramework, logPerfResult: PerfResultCa
6767
}
6868

6969
// start GC clean
70-
if (window.gc) gc!(), gc!();
70+
if (globalThis.gc) gc!(), gc!();
7171

7272
start = performance.now();
7373

7474
fn(n, sources);
7575

7676
// end GC clean
7777
sources = null;
78-
if (window.gc) gc!(), gc!();
78+
if (globalThis.gc) gc!(), gc!();
7979
end = performance.now();
8080
});
8181

src/util/benchRepeat.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ export function runTimed<T>(fn: () => T): TimedResult<T> {
3434

3535
/** run a function, reporting the wall clock time and garbage collection time. */
3636
async function runTracked<T>(fn: () => T): Promise<TimingResult<T>> {
37-
if (window.gc) gc!(), gc!();
37+
if (globalThis.gc) gc!(), gc!();
3838
let out = runTimed(fn);
3939
const { result, time } = out;
4040
return { result, timing: { time } };

0 commit comments

Comments
 (0)