upb: remove base:internal as a dep in upb/benchmarks/

PiperOrigin-RevId: 601306785
pull/15581/head
Eric Salo 10 months ago committed by Copybara-Service
parent 6cf7f9b5f6
commit c32838ac30
  1. 1
      benchmarks/BUILD
  2. 5
      benchmarks/benchmark.cc

@ -83,7 +83,6 @@ cc_test(
"//upb:mem", "//upb:mem",
"//upb:reflection", "//upb:reflection",
"//upb:wire", "//upb:wire",
"//upb/base:internal",
"@com_github_google_benchmark//:benchmark_main", "@com_github_google_benchmark//:benchmark_main",
"@com_google_absl//absl/container:flat_hash_set", "@com_google_absl//absl/container:flat_hash_set",
"@com_google_absl//absl/log:absl_check", "@com_google_absl//absl/log:absl_check",

@ -7,6 +7,7 @@
#include <benchmark/benchmark.h> #include <benchmark/benchmark.h>
#include <math.h>
#include <stdint.h> #include <stdint.h>
#include <string.h> #include <string.h>
@ -23,7 +24,7 @@
#include "benchmarks/descriptor.upb.h" #include "benchmarks/descriptor.upb.h"
#include "benchmarks/descriptor.upbdefs.h" #include "benchmarks/descriptor.upbdefs.h"
#include "benchmarks/descriptor_sv.pb.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/base/upcast.h"
#include "upb/json/decode.h" #include "upb/json/decode.h"
#include "upb/json/encode.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. // 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++) { for (size_t n = 0; n <= max; n++) {
size_t step = 1 << n; size_t step = 1 << n;
for (size_t i = 0; i + step < arenas.size(); i += (step * 2)) { for (size_t i = 0; i + step < arenas.size(); i += (step * 2)) {

Loading…
Cancel
Save