Skip to content

Commit 5ff060d

Browse files
committed
Add timing around fetchModule
1 parent c86c82c commit 5ff060d

File tree

3 files changed

+5
-1
lines changed

3 files changed

+5
-1
lines changed

Diff for: packages/host/config/fastboot.js

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ module.exports = function () {
1616
Request: globalThis.Request,
1717
fetch: globalThis.fetch,
1818
btoa,
19+
performance: globalThis.performance,
1920
});
2021
},
2122
};

Diff for: packages/realm-server/fastboot.ts

+2
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ export async function makeFastBootIndexRunner(
3636
getRunnerOpts,
3737
_logDefinitions: (globalThis as any)._logDefinitions,
3838
jsdom: new JSDOM(''),
39+
performance: globalThis.performance,
3940
});
4041
},
4142
}) as FastBootInstance;
@@ -53,6 +54,7 @@ export async function makeFastBootIndexRunner(
5354
getRunnerOpts,
5455
_logDefinitions: (globalThis as any)._logDefinitions,
5556
jsdom: new JSDOM(''),
57+
performance: globalThis.performance,
5658
});
5759
},
5860
));

Diff for: packages/runtime-common/loader.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import TransformModulesAmdPlugin from 'transform-modules-amd-plugin';
22
import { transformSync } from '@babel/core';
33
import { Deferred } from './deferred';
44
import { trimExecutableExtension, logger } from './index';
5+
import { time } from './helpers/time';
56

67
import { CardError } from './error';
78
import flatMap from 'lodash/flatMap';
@@ -278,7 +279,7 @@ export class Loader {
278279

279280
outer_switch: switch (module?.state) {
280281
case undefined:
281-
await this.fetchModule(resolvedURL);
282+
await time('fetchModule', this.fetchModule(resolvedURL));
282283
break;
283284
case 'fetching':
284285
await module.deferred.promise;

0 commit comments

Comments
 (0)