Reduce accumulated max memory usage (RSS) during build by ~1% (-838 MB) by not including unused C++ standard library headers.
This is a follow-up to now merged #16129 which reduced the memory usage by ~2% (-2632 MB).
Comparing max memory usage (RSS) between old revision 44d81723236114f9370f386f3b3310477a6dde43 (branch master
) and new revision 50f005631f053f2531738f574d4363378b69a5fc (branch c++-standard-library-headers
):
File | Old | New | Diff | Percent |
---|---|---|---|---|
bench/bench_bench_bitcoin-bench_bitcoin.o |
236 MB | 218 MB | -18 MB | -8 % |
libbitcoin_common_a-netbase.o |
281 MB | 263 MB | -18 MB | -6 % |
libbitcoin_common_a-protocol.o |
236 MB | 218 MB | -18 MB | -7 % |
libbitcoin_common_a-warnings.o |
212 MB | 195 MB | -17 MB | -8 % |
libbitcoin_server_a-addrman.o |
286 MB | 270 MB | -17 MB | -6 % |
libbitcoin_server_a-banman.o |
253 MB | 235 MB | -18 MB | -7 % |
libbitcoin_server_a-dbwrapper.o |
287 MB | 269 MB | -18 MB | -6 % |
libbitcoin_server_a-flatfile.o |
239 MB | 221 MB | -18 MB | -8 % |
libbitcoin_server_a-timedata.o |
256 MB | 239 MB | -17 MB | -7 % |
libbitcoin_util_a-chainparamsbase.o |
225 MB | 208 MB | -17 MB | -8 % |
rpc/libbitcoin_cli_a-client.o |
263 MB | 246 MB | -17 MB | -6 % |
rpc/libbitcoin_util_a-protocol.o |
258 MB | 240 MB | -18 MB | -7 % |
util/libbitcoin_util_a-error.o |
220 MB | 202 MB | -17 MB | -8 % |
util/libbitcoin_util_a-threadnames.o |
69 MB | 48 MB | -21 MB | -31 % |
wallet/libbitcoin_wallet_a-walletutil.o |
249 MB | 232 MB | -17 MB | -7 % |
… suppressing 438 unchanged measurements … | … | … | … | … |
Average (N=453) | 319 MB | 317 MB | -2 MB | -1 % |
Sum (N=453) | 144380 MB | 143542 MB | -838 MB | -1 % |
Measured using:
0$ g++ --version
1g++ (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
Please note that the removed headers are not removable by being “transitively included” by other still included headers. Thus the removals are real. (In other words: the naïve and totally pointless “remove as long as it compiles” method to include “reduction” has not be used.)