https://github.com/angular/angular
Raw File
Tip revision: f6c229f755a56c2a795e9e68dce263c5d3c2b57c authored by Andrew Scott on 16 March 2022, 18:26:17 UTC
release: cut the v13.2.7 release (#45363)
Tip revision: f6c229f
ng_benchmark.bzl
# Copyright Google LLC All Rights Reserved.
#
# Use of this source code is governed by an MIT-style license that can be
# found in the LICENSE file at https://angular.io/license
"""Bazel macro for running Angular benchmarks"""

load("@build_bazel_rules_nodejs//:index.bzl", "nodejs_binary")

def ng_benchmark(name, bundle):
    """

    This macro creates two targets, one that is runnable and prints results and one that can be used for profiling via chrome://inspect.

    Args:
      name: name of the runnable rule to create
      bundle: label of the bundle rule to run
    """

    nodejs_binary(
        name = name,
        data = [bundle],
        entry_point = bundle + ".debug.min.js",
        tags = ["local", "manual"],  # run benchmarks locally and never on CI
    )

    nodejs_binary(
        name = name + "_profile",
        data = [bundle],
        entry_point = bundle + ".debug.min.js",
        args = ["--node_options=--no-turbo-inlining --node_options=--inspect-brk"],
        tags = ["local", "manual"],  # run benchmarks locally and never on CI
    )
back to top