Skip to content

Commit 2bf0409

Browse files
committed
refactor(project): Add cache write perf logging
1 parent f858659 commit 2bf0409

2 files changed

Lines changed: 9 additions & 8 deletions

File tree

packages/project/lib/build/ProjectBuilder.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,11 @@ class ProjectBuilder {
324324
if (includedDependencies.length === this._graph.getSize() - 1) {
325325
this.#log.info(` Including all dependencies`);
326326
} else {
327-
this.#log.info(` Requested dependencies:`);
328-
this.#log.info(` + ${includedDependencies.join("\n + ")}`);
327+
this.#log.info(` Requested dependencies:\n + ${includedDependencies.join("\n + ")}`);
329328
}
330329
}
331330
if (excludedDependencies.length) {
332-
this.#log.info(` Excluded dependencies:`);
333-
this.#log.info(` - ${excludedDependencies.join("\n + ")}`);
331+
this.#log.info(` Excluded dependencies:\n - ${excludedDependencies.join("\n + ")}`);
334332
}
335333

336334
const rootProjectName = this._graph.getRoot().getName();

packages/project/lib/build/cache/ProjectBuildCache.js

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -840,12 +840,10 @@ export default class ProjectBuildCache {
840840
* 3. Stores all stage caches from the queue
841841
*
842842
* @public
843-
* @param {object} buildManifest Build manifest containing metadata about the build
844-
* @param {string} buildManifest.manifestVersion Version of the manifest format
845-
* @param {string} buildManifest.signature Build signature
846843
* @returns {Promise<void>}
847844
*/
848-
async writeCache(buildManifest) {
845+
async writeCache() {
846+
const cacheWriteStart = performance.now();
849847
await Promise.all([
850848
this.#writeResultCache(),
851849

@@ -854,6 +852,11 @@ export default class ProjectBuildCache {
854852

855853
this.#writeSourceIndex(),
856854
]);
855+
if (log.isLevelEnabled("perf")) {
856+
log.perf(
857+
`Wrote build cache for project ${this.#project.getName()} in ` +
858+
`${(performance.now() - cacheWriteStart).toFixed(2)} ms`);
859+
}
857860
}
858861

859862
/**

0 commit comments

Comments
 (0)