b804266f72
This adds Google benchmark for microbenchmarking C++ code as an optional dependency. To enable, add the following to the .gclient before syncing "custom_vars": { "checkout_google_benchmark": True } Change-Id: Id0eab772dd71558906658ef4bb60e31acd665948 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2275964 Reviewed-by: Hannes Payer <hpayer@chromium.org> Reviewed-by: Anton Bikineev <bikineev@chromium.org> Reviewed-by: Michael Achenbach <machenbach@chromium.org> Commit-Queue: Michael Lippautz <mlippautz@chromium.org> Cr-Commit-Position: refs/heads/master@{#68663}
13 lines
383 B
C++
13 lines
383 B
C++
// Copyright 2020 the V8 project authors. All rights reserved.
|
|
// Use of this source code is governed by a BSD-style license that can be
|
|
// found in the LICENSE file.
|
|
|
|
#include "third_party/google_benchmark/src/include/benchmark/benchmark.h"
|
|
|
|
static void BM_Empty(benchmark::State& state) {
|
|
for (auto _ : state) {
|
|
}
|
|
}
|
|
// Register the function as a benchmark
|
|
BENCHMARK(BM_Empty);
|