Repository navigation
build: remove code nothing links; stop sed-patching fc's CMake in CI - #227
Merged
Merged
Conversation
Linker maps of all 23 executables (vizd, cli_wallet, every ctest binary, the
util tools) show these objects are never loaded and their headers have no
includer outside the dead set:
libraries/api: discussion_helper, content_api_object, discussion.hpp,
vote_state.hpp, account_vote.hpp (Steem discussion API leftovers)
libraries/chain: chain_objects.cpp (entirely commented out)
libraries/utilities: string_escape, tempdir, padding_ostream.hpp
wallet.hpp drops its stale <fc/real128.hpp> include; the wallet CMake drops an
add_custom_command whose output nothing consumed.
fc submodule -> fc#5, which removes the libfc.a members nothing links and
defaults BUILD_FC_TESTS to OFF, so the five `sed -i '/add_subdirectory(tests)/d'`
lines in the workflows go away.
Measured: the removed TUs are ~85 CPU-s of a ~43 CPU-min full build. Cleanup,
not a speedup; the real cost stays in database.cpp / wallet.cpp codegen.
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.
Second pass after #213: find code that is compiled but never linked, using the linker itself rather than grep.
Method. Relink all 23 executables (
vizd,cli_wallet, 14 ctest binaries, util tools,appbase_example,chainbase_test) with-Wl,-map, collect which static-archive members each one loads, diff againstar t. A member no binary loads, whose header no live file includes, is dead. Cross-checked with annmsymbol-reference graph.Removed here
libraries/api:discussion_helper.{hpp,cpp},content_api_object.{hpp,cpp},discussion.hpp,vote_state.hpp,account_vote.hpp— Steem discussion-API leftovers, included only by each other.libraries/chain/chain_objects.cpp— 121 lines, all commented out.libraries/utilities:string_escape,tempdir,padding_ostream.hpp— no includer.wallet.hpp: stale<fc/real128.hpp>include.wallet/CMakeLists.txt: anadd_custom_commandwhose output no target consumed.sed -i '/add_subdirectory(tests)/d' thirdparty/fc/CMakeLists.txtlines, now that fc defaultsBUILD_FC_TESTSto OFF.Removed in fc (VIZ-Blockchain/fc#5, submodule bumped): 17 modules + the cyoencode vendor lib +
src/ssh/pkethat were never built. Table and rationale in that PR. Merge fc#5 first.Honest numbers
appbase_example+chainbase_test(left alone, only built bymake all, not by Docker/CI)This is cleanup, not a speedup. Everything else in the tree is loaded by some binary. The build time lives in the top five TUs (
database.cpp248 s,wallet.cpp162 s,dlt_p2p_node.cpp130 s,operations.cpp127 s,snapshot/plugin.cpp102 s) and is optimizer time onfc::rawvisitor instantiations, as profiled in #213. Cutting that means explicit instantiation of the block/operation serializers or splittingdatabase.cpp, which is a different PR.Verification
check-arm64+check-boost-rangeadded so the distro-Boost 1.83 and arm64 jobs exercise the fc CMake change.