angular/modules/ssr-benchmarks/BUILD.bazel
Matthieu Riegler 84b6896956 refactor(platform-server): Add an ssr benchmark setup. (#57647)
In order to investigate the performances of SSR, this commit introduces a benchmark suite which will measure several step of the rendering.

PR Close #57647
2024-10-04 10:45:22 -07:00

61 lines
2.2 KiB
Text

load("//integration:index.bzl", "ng_integration_test")
ng_integration_test(
name = "run",
commands = [
"yarn install --cache-folder ./.yarn_local_cache",
"yarn ng build",
"node ./dist/ssr-benchmarks/server/server.mjs",
],
)
## This target is intended to run the benchmark in a browser
## For this the benchmark script is loaded by an html page serve the http-server script
## Note: This target doesn't end until the http-server is stopped. It should not run as part of our testset.
ng_integration_test(
name = "run_browser",
commands = [
"yarn install --cache-folder ./.yarn_local_cache",
# The patch only applies for the browser target (to remove the DOM Emulation polyfills and browser incompatible code)
"yarn patch",
#
"NG_BUILD_MANGLE=0 yarn ng build --configuration production,browser",
"yarn http-server ./dist",
],
)
# This target is mostly intended for investigating via the devTools using the flamechart
ng_integration_test(
name = "run_browser_emulated_dom",
commands = [
"yarn install --cache-folder ./.yarn_local_cache",
# We keep the emulated dom in this target
# But still need to drop the node import which doesn't work in browsers.
"git apply patches/@angular-devkit+build-angular++@angular+build+19.0.0-next.6+require.patch",
# We keep the symbols with the NG_BUILD_MANGLE flag
"NG_BUILD_MANGLE=0 yarn ng build",
"yarn http-server ./dist",
],
)
# This is a target to investigate with deopt explorer (https://github.com/microsoft/deoptexplorer-vscode)
# The v8 log file will be generated in the test directory
ng_integration_test(
name = "run_deopt",
commands = [
"yarn install --cache-folder ./.yarn_local_cache",
"NG_BUILD_MANGLE=0 yarn ng build",
"yarn node --prof \
--log-deopt \
--log-ic \
--log-maps \
--log-maps-details \
--log-internal-timer-events \
--log-code \
--log-source-code \
--detailed-line-info \
./dist/ssr-benchmarks/server/server.mjs narrowRun",
],
)