Skip to content

Commit ccb60ab

Browse files
clydinalan-agius4
authored andcommitted
refactor(@angular-devkit/build-angular): disable Piscina timing information recording
The latest version of the worker pool package used by the build system (`Piscina`) now has an option to disable performance timing information. Since the build system does not currently use that information, disabling it avoids the extra overhead of histogram creation and usage. This information collection could potentially be enabled conditionally in the future if needed.
1 parent de49f93 commit ccb60ab

File tree

8 files changed

+10
-0
lines changed

8 files changed

+10
-0
lines changed

packages/angular_devkit/build_angular/src/builders/app-shell/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@ async function _renderUniversal(
7171
filename: require.resolve('./render-worker'),
7272
maxThreads: 1,
7373
workerData: { zonePackage },
74+
recordTiming: false,
7475
});
7576

7677
try {

packages/angular_devkit/build_angular/src/builders/prerender/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ async function getRoutes(
6868
serverBundlePath,
6969
zonePackage: require.resolve('zone.js', { paths: [workspaceRoot] }),
7070
} as RoutesExtractorWorkerData,
71+
recordTiming: false,
7172
});
7273

7374
const extractedRoutes: string[] = await renderWorker
@@ -175,6 +176,7 @@ async function _renderUniversal(
175176
filename: path.join(__dirname, 'render-worker.js'),
176177
maxThreads: maxWorkers,
177178
workerData: { zonePackage },
179+
recordTiming: false,
178180
});
179181

180182
let routes: string[] | undefined;

packages/angular_devkit/build_angular/src/tools/esbuild/angular/compilation/parallel-compilation.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ export class ParallelCompilation extends AngularCompilation {
4040
// is used when the Atomics based wait loop is enable.
4141
useAtomics: !process.versions.webcontainer,
4242
filename: localRequire.resolve('./parallel-worker'),
43+
recordTiming: false,
4344
});
4445
}
4546

packages/angular_devkit/build_angular/src/tools/esbuild/i18n-inliner.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ export class I18nInliner {
9797
shouldOptimize: options.shouldOptimize,
9898
files,
9999
},
100+
recordTiming: false,
100101
});
101102
}
102103

packages/angular_devkit/build_angular/src/tools/esbuild/javascript-transformer.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@ export class JavaScriptTransformer {
6161
maxThreads: this.maxThreads,
6262
// Shutdown idle threads after 1 second of inactivity
6363
idleTimeout: 1000,
64+
recordTiming: false,
6465
});
6566

6667
return this.#workerPool;

packages/angular_devkit/build_angular/src/tools/webpack/plugins/javascript-optimizer-plugin.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,7 @@ export class JavaScriptOptimizerPlugin {
177177
const workerPool = new Piscina({
178178
filename: workerPath,
179179
maxThreads: MAX_OPTIMIZE_WORKERS,
180+
recordTiming: false,
180181
});
181182

182183
// Enqueue script optimization tasks and update compilation assets as the tasks complete

packages/angular_devkit/build_angular/src/utils/action-executor.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export class BundleActionExecutor {
2828
name: 'inlineLocales',
2929
workerData: this.workerOptions,
3030
maxThreads: maxWorkers,
31+
recordTiming: false,
3132
});
3233

3334
return this.workerPool;

packages/angular_devkit/build_angular/src/utils/server-rendering/prerender.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ async function renderPages(
174174
document,
175175
} as RenderWorkerData,
176176
execArgv: workerExecArgv,
177+
recordTiming: false,
177178
});
178179

179180
try {
@@ -261,6 +262,7 @@ async function getAllRoutes(
261262
verbose,
262263
} as RoutesExtractorWorkerData,
263264
execArgv: workerExecArgv,
265+
recordTiming: false,
264266
});
265267

266268
const { routes: extractedRoutes, warnings }: RoutersExtractorWorkerResult = await renderWorker

0 commit comments

Comments
 (0)