From c32838ac30699eeb2ea4507d9ecacdc51bf87a9c Mon Sep 17 00:00:00 2001 From: Eric Salo Date: Wed, 24 Jan 2024 19:31:31 -0800 Subject: [PATCH] upb: remove base:internal as a dep in upb/benchmarks/ PiperOrigin-RevId: 601306785 --- benchmarks/BUILD | 1 - benchmarks/benchmark.cc | 5 +++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/benchmarks/BUILD b/benchmarks/BUILD index 3b9a9cbde0..8c310a69bf 100644 --- a/benchmarks/BUILD +++ b/benchmarks/BUILD @@ -83,7 +83,6 @@ cc_test( "//upb:mem", "//upb:reflection", "//upb:wire", - "//upb/base:internal", "@com_github_google_benchmark//:benchmark_main", "@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/log:absl_check", diff --git a/benchmarks/benchmark.cc b/benchmarks/benchmark.cc index c9658eae72..6d9660a87c 100644 --- a/benchmarks/benchmark.cc +++ b/benchmarks/benchmark.cc @@ -7,6 +7,7 @@ #include +#include #include #include @@ -23,7 +24,7 @@ #include "benchmarks/descriptor.upb.h" #include "benchmarks/descriptor.upbdefs.h" #include "benchmarks/descriptor_sv.pb.h" -#include "upb/base/internal/log2.h" +#include "upb/base/string_view.h" #include "upb/base/upcast.h" #include "upb/json/decode.h" #include "upb/json/encode.h" @@ -97,7 +98,7 @@ static void BM_ArenaFuseBalanced(benchmark::State& state) { } // Perform a series of fuses that keeps the halves balanced. - size_t max = upb_Log2Ceiling(arenas.size()); + const size_t max = ceil(log2(double(arenas.size()))); for (size_t n = 0; n <= max; n++) { size_t step = 1 << n; for (size_t i = 0; i + step < arenas.size(); i += (step * 2)) {