MCPcopy Create free account
hub / github.com/apple/coremltools / RegisterBenchmarks

Function RegisterBenchmarks

deps/protobuf/benchmarks/cpp/cpp_benchmark.cc:216–238  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214}
215
216void RegisterBenchmarks(const std::string& dataset_bytes) {
217 BenchmarkDataset dataset;
218 GOOGLE_CHECK(dataset.ParseFromString(dataset_bytes));
219
220 if (dataset.message_name() == "benchmarks.proto3.GoogleMessage1") {
221 RegisterBenchmarksForType<benchmarks::proto3::GoogleMessage1>(dataset);
222 } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage1") {
223 RegisterBenchmarksForType<benchmarks::proto2::GoogleMessage1>(dataset);
224 } else if (dataset.message_name() == "benchmarks.proto2.GoogleMessage2") {
225 RegisterBenchmarksForType<benchmarks::proto2::GoogleMessage2>(dataset);
226 } else if (dataset.message_name() ==
227 "benchmarks.google_message3.GoogleMessage3") {
228 RegisterBenchmarksForType
229 <benchmarks::google_message3::GoogleMessage3>(dataset);
230 } else if (dataset.message_name() ==
231 "benchmarks.google_message4.GoogleMessage4") {
232 RegisterBenchmarksForType
233 <benchmarks::google_message4::GoogleMessage4>(dataset);
234 } else {
235 std::cerr << "Unknown message type: " << dataset.message_name();
236 exit(1);
237 }
238}
239
240int main(int argc, char *argv[]) {
241 ::benchmark::Initialize(&argc, argv);

Callers 1

mainFunction · 0.85

Calls 1

ParseFromStringMethod · 0.45

Tested by

no test coverage detected