Skip to content

Commit 19b0534

Browse files
committed
benchmarks: add support for capnp benchmarks
Also rename workerd-google_benchmark - there is no reason to have a different name any project can decide to use a different dependency for that instead the same way we do. Besides we don't prefix other deps with workerd-
1 parent 71b6469 commit 19b0534

File tree

8 files changed

+15
-19
lines changed

8 files changed

+15
-19
lines changed

.github/workflows/codspeed.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
name: Run benchmarks
2727
runs-on: ubuntu-22.04
2828
env:
29-
BAZEL_ARGS: --config=benchmark --@workerd-google-benchmark//:codspeed_mode=instrumentation --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev
29+
BAZEL_ARGS: --config=benchmark --@google_benchmark//:codspeed_mode=instrumentation --remote_cache=https://bazel:${{ secrets.BAZEL_CACHE_KEY }}@bazel-remote-cache.devprod.cloudflare.dev
3030
steps:
3131
- uses: actions/checkout@v4
3232
with:
@@ -44,13 +44,13 @@ jobs:
4444

4545
- name: Build benchmarks
4646
run: |
47-
bazel build ${{ env.BAZEL_ARGS }} --build_tag_filters=benchmark-binary //...
47+
bazel build ${{ env.BAZEL_ARGS }} --build_tag_filters=google_benchmark //... @capnp-cpp//...
4848
4949
- name: Generate benchmark script
5050
run: |
5151
echo '#!/bin/bash' > run_benchmarks.sh
5252
echo 'set -ex' >> run_benchmarks.sh
53-
targets=$(bazel query 'attr(tags, "benchmark-binary", //...)' --output=label 2>/dev/null)
53+
targets=$(bazel query 'attr(tags, "[\[ ]google_benchmark[,\]]", //... + @capnp-cpp//...)' --output=label 2>/dev/null)
5454
for target in $targets; do
5555
echo "echo 'Running benchmark: $target'" >> run_benchmarks.sh
5656
echo "bazel run ${{ env.BAZEL_ARGS }} $target -- --benchmark_min_time=1s" >> run_benchmarks.sh

build/deps/gen/dep_capnp_cpp.bzl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
load("@//:build/http.bzl", "http_archive")
44

5-
URL = "https://github.com/capnproto/capnproto/tarball/e2881d1d8179c097558718dda4ca9139ea0e1d28"
6-
STRIP_PREFIX = "capnproto-capnproto-e2881d1/c++"
7-
SHA256 = "1f8f5617f0752d6d29e438b3e1e483e0f76307c21a972fd404f7deb870c86891"
5+
URL = "https://github.com/capnproto/capnproto/tarball/c6e0a03f7398d985fedcfa40c95d1d9ecb36a92d"
6+
STRIP_PREFIX = "capnproto-capnproto-c6e0a03/c++"
7+
SHA256 = "f8ac6c426e63a3be7596b7d5adeb5edcb35dcc198a74af7f6c70d5e7dd7c76e6"
88
TYPE = "tgz"
9-
COMMIT = "e2881d1d8179c097558718dda4ca9139ea0e1d28"
9+
COMMIT = "c6e0a03f7398d985fedcfa40c95d1d9ecb36a92d"
1010

1111
def dep_capnp_cpp():
1212
http_archive(

build/deps/v8.MODULE.bazel

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -105,12 +105,8 @@ local_path_override(
105105
path = "build/workerd-v8",
106106
)
107107

108-
# Tell workerd code where to find google-benchmark with CodSpeed.
109-
#
110-
# We indirect through `@workerd-google-benchmark` to allow dependents to override how and where
111-
# google-benchmark is built, similar to the v8 setup above.
112-
bazel_dep(name = "workerd-google-benchmark")
108+
bazel_dep(name = "google_benchmark")
113109
local_path_override(
114-
module_name = "workerd-google-benchmark",
110+
module_name = "google_benchmark",
115111
path = "build/google-benchmark",
116112
)

build/google-benchmark/MODULE.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
module(name = "workerd-google-benchmark")
1+
module(name = "google_benchmark")
22

33
bazel_dep(name = "bazel_skylib", version = "1.8.1")
44
bazel_dep(name = "platforms", version = "1.0.0")

build/wd_cc_benchmark.bzl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,12 @@ def wd_cc_benchmark(
2626
}),
2727
visibility = visibility,
2828
deps = deps + [
29-
"@workerd-google-benchmark//:benchmark_main",
29+
"@google_benchmark//:benchmark_main",
3030
"//src/workerd/tests:bench-tools",
3131
],
3232
# use the same malloc we use for server
3333
malloc = "//src/workerd/server:malloc",
34-
tags = ["workerd-benchmark", "benchmark-binary"],
34+
tags = ["workerd-benchmark", "google_benchmark"],
3535
size = "large",
3636
**kwargs
3737
)

compile_flags.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,7 @@
143143
-Iexternal/+_repo_rules2+simdutf/
144144
-Iexternal/+_repo_rules+nbytes/include/
145145
-Iexternal/+_repo_rules+ncrypto/include
146-
-Iexternal/workerd-google-benchmark++_repo_rules+codspeed/google_benchmark/include/
146+
-Iexternal/google_benchmark++_repo_rules+codspeed/google_benchmark/include/
147147
-Iexternal/perfetto+/include/
148148
-Iexternal/perfetto+/include/perfetto/base/build_configs/bazel/
149149
-Ibazel-bin/external/perfetto+/

justfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ create-external:
126126
tools/unix/create-external.sh
127127

128128
bench-all:
129-
bazel query 'attr(tags, "benchmark-binary", //...)' --output=label | xargs -I {} bazel run --config=benchmark {}
129+
bazel query 'attr(tags, "[\[ ]google_benchmark[,\]]", //... + @capnp-cpp//...)' --output=label | xargs -I {} bazel run --config=benchmark {}
130130

131131
eslint:
132132
just stream-test \

src/workerd/tests/BUILD.bazel

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ wd_cc_library(
1010
visibility = ["//visibility:public"],
1111
deps = [
1212
"@capnp-cpp//src/kj:kj-test",
13-
"@workerd-google-benchmark//:benchmark",
13+
"@google_benchmark//:benchmark",
1414
],
1515
)
1616

0 commit comments

Comments
 (0)