From f803670de71a11d9d8696c8aff6603513d025ac3 Mon Sep 17 00:00:00 2001 From: serge-sans-paille Date: Fri, 6 Sep 2024 09:25:44 -0700 Subject: [PATCH] Remove or replace useless references to (#18069) embeds a global constructor (to initialize std::cout and such), typically `static ios_base::Init __ioinit;` in libstdc++). Replacing it by , (or both) when possible has an impact on the number of global constructors involved (and thus on the number of instructions executed at startup). Closes #18069 COPYBARA_INTEGRATE_REVIEW=https://github.com/protocolbuffers/protobuf/pull/18069 from serge-sans-paille:feature/remove-useless-iostream 42d1458235796a9a0f340c2599e57d61294f4341 PiperOrigin-RevId: 671788440 --- .../protobuf/compiler/cpp/tools/analyze_profile_proto.cc | 2 +- src/google/protobuf/compiler/rust/relative_path.cc | 1 - src/google/protobuf/compiler/subprocess.cc | 2 +- src/google/protobuf/descriptor.cc | 1 - src/google/protobuf/descriptor_unittest.cc | 1 - src/google/protobuf/io/zero_copy_stream_impl.cc | 3 ++- 6 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc b/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc index c5b300b7c3..1da40b5a35 100644 --- a/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc +++ b/src/google/protobuf/compiler/cpp/tools/analyze_profile_proto.cc @@ -10,8 +10,8 @@ #include #include #include -#include #include +#include #include #include #include diff --git a/src/google/protobuf/compiler/rust/relative_path.cc b/src/google/protobuf/compiler/rust/relative_path.cc index 7c083f554b..e214dada43 100644 --- a/src/google/protobuf/compiler/rust/relative_path.cc +++ b/src/google/protobuf/compiler/rust/relative_path.cc @@ -7,7 +7,6 @@ #include "google/protobuf/compiler/rust/relative_path.h" -#include #include #include diff --git a/src/google/protobuf/compiler/subprocess.cc b/src/google/protobuf/compiler/subprocess.cc index 8162df2df5..e505ddb61a 100644 --- a/src/google/protobuf/compiler/subprocess.cc +++ b/src/google/protobuf/compiler/subprocess.cc @@ -11,7 +11,7 @@ #include #include -#include +#include #ifndef _WIN32 #include diff --git a/src/google/protobuf/descriptor.cc b/src/google/protobuf/descriptor.cc index 93b54e615e..c38d8e008f 100644 --- a/src/google/protobuf/descriptor.cc +++ b/src/google/protobuf/descriptor.cc @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/src/google/protobuf/descriptor_unittest.cc b/src/google/protobuf/descriptor_unittest.cc index b08d6a9d52..2f224e7f74 100644 --- a/src/google/protobuf/descriptor_unittest.cc +++ b/src/google/protobuf/descriptor_unittest.cc @@ -20,7 +20,6 @@ #include #include #include -#include #include #include #include diff --git a/src/google/protobuf/io/zero_copy_stream_impl.cc b/src/google/protobuf/io/zero_copy_stream_impl.cc index a5f7b6958c..a7a0a60c94 100644 --- a/src/google/protobuf/io/zero_copy_stream_impl.cc +++ b/src/google/protobuf/io/zero_copy_stream_impl.cc @@ -18,7 +18,8 @@ #include #include -#include +#include +#include #include "google/protobuf/stubs/common.h" #include "absl/log/absl_check.h"