build: eliminate precompiled headers from bazel build.#799
Closed
htuch wants to merge 1 commit intoenvoyproxy:masterfrom
Closed
build: eliminate precompiled headers from bazel build.#799htuch wants to merge 1 commit intoenvoyproxy:masterfrom
htuch wants to merge 1 commit intoenvoyproxy:masterfrom
Conversation
Member
|
looks good but obviously needs master merged now |
Since Bazel doesn't support precompiled headers (bazelbuild/bazel#1215), we actually suffer a slowdown rather than speedup by having all files implicitly include precompiled.h in the Bazel build. I found ~10% performance improvement on my workstation, going from 181s to 163s for a "bazel build //test/..." from a "bazel clean" state. This patch makes all includes now explicit. This will slowdown the cmake build, but since this is not long for this world it seems alright. The header reordering in this patch was achieved using envoyproxy#793. The addition of the missing headers in each file was done using a modified version of the tool in envoyproxy#793, which substituted in headers based on simple substring matches (e.g. whenever it saw std::string in a file, it added #include <string>). Here's the patterns I ended up using that seemed to work: sys_extra_includes = [ ('std::runtime_error', 'stdexcept'), ('strcmp', 'string.h'), ('strcasecmp', 'strings.h'), ('std::unique_ptr', 'memory'), ('std::shared_ptr', 'memory'), ('std::unordered_set', 'unordered_set'), ('std::transform', 'algorithm'), ('std::vector', 'vector'), ('std::regex', 'regex'), ('spdlog::', 'spdlog/spdlog.h'), ('fmt::format', 'spdlog/spdlog.h'), ('std::string', 'string'), ('uint32_t', 'cstdint'), ('uint64_t', 'cstdint'), ('std::array', 'array'), ('sockaddr_un', 'sys/un.h'), ('sockaddr_in', 'netinet/ip.h'), ('std::chrono', 'chrono'), ('std::list', 'list'), ('std::multimap', 'map'), ('std::unordered_map', 'unordered_map'), ('std::stringstream', 'sstream'), ('std::condition_variable', 'condition_variable'), ('std::mutex', 'mutex'), (' ::close', 'unistd.h'), ('inet_ntop', 'arpa/inet.h'), ('inet_pton', 'arpa/inet.h'), ('htonl', 'arpa/inet.h'), ('setsockopt', 'sys/types.h'), ('setsockopt', 'sys/socket.h'), ('TCP_NODELAY', 'netinet/tcp.h'), ('SIGTERM', 'signal.h'), ('SIGPIPE', 'signal.h'), ('std::function', 'functional'), ('std::ifstream', 'fstream'), ('std::ofstream', 'fstream'), ('std::forward_list', 'forward_list'), ('std::atomic', 'atomic'), ('std::cerr', 'iostream'), ('hostent', 'netdb.h'), (' bind(', 'sys/types.h'), (' bind(', 'sys/socket.h'), ('std::ostream', 'iostream'), ] extra_includes = [ ('MOCK_METHOD', 'gmock/gmock.h'), ('MOCK_CONST_METHOD', 'gmock/gmock.h'), ('MATCHER_P', 'gmock/gmock.h'), ('ON_CALL', 'gmock/gmock.h'), ('using testing::_', 'gmock/gmock.h'), ('testing::Test', 'gtest/gtest.h'), ('EXPECT_', 'gtest/gtest.h'), ('\nTEST(', 'gtest/gtest.h'), ('\nTEST_F(', 'gtest/gtest.h'), ('\nTEST_P(', 'gtest/gtest.h'), ('HeaderMapImpl', 'test/test_common/printers.h'), ('Buffer::', 'test/test_common/printers.h'), ('RespValue', 'test/test_common/printers.h'), ]
12e840b to
f02c5db
Compare
mattklein123
approved these changes
Apr 20, 2017
Member
|
Yay GH. This change is actually merged. |
Member
|
Closing, I guess? |
htuch
added a commit
to htuch/envoy
that referenced
this pull request
Apr 20, 2017
Since Bazel doesn't support precompiled headers (bazelbuild/bazel#1215), we actually suffer a slowdown rather than speedup by having all files implicitly include precompiled.h in the Bazel build. I found ~10% performance improvement on my workstation, going from 181s to 163s for a "bazel build //test/..." from a "bazel clean" state. This patch makes all includes now explicit. This will slowdown the cmake build, but since this is not long for this world it seems alright. The header reordering in this patch was achieved using envoyproxy#793. The addition of the missing headers in each file was done using a modified version of the tool in envoyproxy#793, which substituted in headers based on simple substring matches (e.g. whenever it saw std::string in a file, it added #include <string>). Here's the patterns I ended up using that seemed to work: sys_extra_includes = [ ('std::runtime_error', 'stdexcept'), ('strcmp', 'string.h'), ('strcasecmp', 'strings.h'), ('std::unique_ptr', 'memory'), ('std::shared_ptr', 'memory'), ('std::unordered_set', 'unordered_set'), ('std::transform', 'algorithm'), ('std::vector', 'vector'), ('std::regex', 'regex'), ('spdlog::', 'spdlog/spdlog.h'), ('fmt::format', 'spdlog/spdlog.h'), ('std::string', 'string'), ('uint32_t', 'cstdint'), ('uint64_t', 'cstdint'), ('std::array', 'array'), ('sockaddr_un', 'sys/un.h'), ('sockaddr_in', 'netinet/ip.h'), ('std::chrono', 'chrono'), ('std::list', 'list'), ('std::multimap', 'map'), ('std::unordered_map', 'unordered_map'), ('std::stringstream', 'sstream'), ('std::condition_variable', 'condition_variable'), ('std::mutex', 'mutex'), (' ::close', 'unistd.h'), ('inet_ntop', 'arpa/inet.h'), ('inet_pton', 'arpa/inet.h'), ('htonl', 'arpa/inet.h'), ('setsockopt', 'sys/types.h'), ('setsockopt', 'sys/socket.h'), ('TCP_NODELAY', 'netinet/tcp.h'), ('SIGTERM', 'signal.h'), ('SIGPIPE', 'signal.h'), ('std::function', 'functional'), ('std::ifstream', 'fstream'), ('std::ofstream', 'fstream'), ('std::forward_list', 'forward_list'), ('std::atomic', 'atomic'), ('std::cerr', 'iostream'), ('hostent', 'netdb.h'), (' bind(', 'sys/types.h'), (' bind(', 'sys/socket.h'), ('std::ostream', 'iostream'), ] extra_includes = [ ('MOCK_METHOD', 'gmock/gmock.h'), ('MOCK_CONST_METHOD', 'gmock/gmock.h'), ('MATCHER_P', 'gmock/gmock.h'), ('ON_CALL', 'gmock/gmock.h'), ('using testing::_', 'gmock/gmock.h'), ('testing::Test', 'gtest/gtest.h'), ('EXPECT_', 'gtest/gtest.h'), ('\nTEST(', 'gtest/gtest.h'), ('\nTEST_F(', 'gtest/gtest.h'), ('\nTEST_P(', 'gtest/gtest.h'), ('HeaderMapImpl', 'test/test_common/printers.h'), ('Buffer::', 'test/test_common/printers.h'), ('RespValue', 'test/test_common/printers.h'), ]
htuch
added a commit
to htuch/envoy
that referenced
this pull request
Apr 20, 2017
mattklein123
pushed a commit
that referenced
this pull request
Apr 20, 2017
jpsim
pushed a commit
that referenced
this pull request
Nov 28, 2022
These are never called in practice today. Since we don't want to support them in the initial version of filters, we're removing them from the public interfaces now. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
jpsim
pushed a commit
that referenced
this pull request
Nov 29, 2022
These are never called in practice today. Since we don't want to support them in the initial version of filters, we're removing them from the public interfaces now. Signed-off-by: Michael Rebello <me@michaelrebello.com> Signed-off-by: JP Simard <jp@jpsim.com>
mathetake
added a commit
that referenced
this pull request
Mar 3, 2026
**Description** This commit uses "Install" func instead of AddToScheme(Deprecated). --------- Signed-off-by: googs1025 <googs1025@gmail.com> Co-authored-by: Takeshi Yoneda <t.y.mathetake@gmail.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Since Bazel doesn't support precompiled headers (bazelbuild/bazel#1215),
we actually suffer a slowdown rather than speedup by having all files implicitly include
precompiled.h in the Bazel build. I found ~10% performance improvement on my workstation, going from
181s to 163s for a "bazel build //test/..." from a "bazel clean" state.
This patch makes all includes now explicit. This will slowdown the cmake build, but since this is
not long for this world it seems alright. The header reordering in this patch was achieved using #793.
The addition of the missing headers in each file was done using a modified version of the tool in #793,
which substituted in headers based on simple substring matches (e.g. whenever it saw std::string in
a file, it added #include ). Here's the patterns I ended up using that seemed to work:
sys_extra_includes = [
('std::runtime_error', 'stdexcept'),
('strcmp', 'string.h'),
('strcasecmp', 'strings.h'),
('std::unique_ptr', 'memory'),
('std::shared_ptr', 'memory'),
('std::unordered_set', 'unordered_set'),
('std::transform', 'algorithm'),
('std::vector', 'vector'),
('std::regex', 'regex'),
('spdlog::', 'spdlog/spdlog.h'),
('fmt::format', 'spdlog/spdlog.h'),
('std::string', 'string'),
('uint32_t', 'cstdint'),
('uint64_t', 'cstdint'),
('std::array', 'array'),
('sockaddr_un', 'sys/un.h'),
('sockaddr_in', 'netinet/ip.h'),
('std::chrono', 'chrono'),
('std::list', 'list'),
('std::multimap', 'map'),
('std::unordered_map', 'unordered_map'),
('std::stringstream', 'sstream'),
('std::condition_variable', 'condition_variable'),
('std::mutex', 'mutex'),
(' ::close', 'unistd.h'),
('inet_ntop', 'arpa/inet.h'),
('inet_pton', 'arpa/inet.h'),
('htonl', 'arpa/inet.h'),
('setsockopt', 'sys/types.h'),
('setsockopt', 'sys/socket.h'),
('TCP_NODELAY', 'netinet/tcp.h'),
('SIGTERM', 'signal.h'),
('SIGPIPE', 'signal.h'),
('std::function', 'functional'),
('std::ifstream', 'fstream'),
('std::ofstream', 'fstream'),
('std::forward_list', 'forward_list'),
('std::atomic', 'atomic'),
('std::cerr', 'iostream'),
('hostent', 'netdb.h'),
(' bind(', 'sys/types.h'),
(' bind(', 'sys/socket.h'),
('std::ostream', 'iostream'),
]
extra_includes = [
('MOCK_METHOD', 'gmock/gmock.h'),
('MOCK_CONST_METHOD', 'gmock/gmock.h'),
('MATCHER_P', 'gmock/gmock.h'),
('ON_CALL', 'gmock/gmock.h'),
('using testing::', 'gmock/gmock.h'),
('testing::Test', 'gtest/gtest.h'),
('EXPECT', 'gtest/gtest.h'),
('\nTEST(', 'gtest/gtest.h'),
('\nTEST_F(', 'gtest/gtest.h'),
('\nTEST_P(', 'gtest/gtest.h'),
('HeaderMapImpl', 'test/test_common/printers.h'),
('Buffer::', 'test/test_common/printers.h'),
('RespValue', 'test/test_common/printers.h'),
]