| 214 | } |
| 215 | |
| 216 | void 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 | |
| 240 | int main(int argc, char *argv[]) { |
| 241 | ::benchmark::Initialize(&argc, argv); |