Skip to content

Commit

Permalink
NFC Fix comment in bench-tools.h (#2568)
Browse files Browse the repository at this point in the history
I don't see any reason to use block comments and line continuations here, line
comments are used elsewhere in the file and work fine. Also clang-format seems
to not like it
  • Loading branch information
hoodmane authored Aug 21, 2024
1 parent 1c54402 commit 6654769
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions src/workerd/tests/bench-tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@
// enough to not need ns precision.
#define WD_BENCHMARK(X) BENCHMARK(X)->Unit(benchmark::kMicrosecond)

/* Macro inspired by KJ_TEST() to enable benchmarking without requiring the benchmark::State */ \
/* argument and make it easy to convert tests to benchmarks. */ /* Make sure the linker fails if tests are not in anonymous namespaces. */ \
#define WD_BENCH(description) \
extern int KJ_CONCAT(YouMustWrapTestsInAnonymousNamespace, __COUNTER__) KJ_UNUSED; \
void KJ_UNIQUE_NAME(Bench)(); \
void KJ_UNIQUE_NAME(BenchImpl)(benchmark::State & state) { \
for (auto _: state) { \
KJ_UNIQUE_NAME(Bench)(); \
} \
} \
WD_BENCHMARK(KJ_UNIQUE_NAME(BenchImpl))->Name(description); \
// Macro inspired by KJ_TEST() to enable benchmarking without requiring the benchmark::State
// argument and make it easy to convert tests to benchmarks. Make sure the linker fails if tests are
// not in anonymous namespaces.
#define WD_BENCH(description) \
extern int KJ_CONCAT(YouMustWrapTestsInAnonymousNamespace, __COUNTER__) KJ_UNUSED; \
void KJ_UNIQUE_NAME(Bench)(); \
void KJ_UNIQUE_NAME(BenchImpl)(benchmark::State & state) { \
for (auto _: state) { \
KJ_UNIQUE_NAME(Bench)(); \
} \
} \
WD_BENCHMARK(KJ_UNIQUE_NAME(BenchImpl))->Name(description); \
void KJ_UNIQUE_NAME(Bench)()

0 comments on commit 6654769

Please sign in to comment.