Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4.0 binaries are large #2090

Closed
3 tasks
abitmore opened this issue Jan 25, 2020 · 3 comments
Closed
3 tasks

4.0 binaries are large #2090

abitmore opened this issue Jan 25, 2020 · 3 comments

Comments

@abitmore
Copy link
Member

Description
When building with cmake -DCMAKE_BUILD_TYPE=Release . && make, the produced binaries of test-4.0.x are much larger than the test-3.x ones.

 38M witness_node.test-3.3.4
164M witness_node.test-4.0.4

 45M cli_wallet.test-3.3.4
173M cli_wallet.test-4.0.4

I think it's abnormal.

It's probably caused by some CMake changes applied in 4.0.

Build Environment
Details about the build environment, including the relevant required libraries. Much of this information can be found in the CMakeFiles/CMakeOutput.log.

  • Host OS: Ubuntu 16.04 LTS
  • Host Physical RAM 16GB
  • Source Branch/Tag: test-4.0.4
  • OpenSSL Version: 1.0.2g
  • Boost Version: 1.58
  • C++ Compiler: gcc 5.4

CORE TEAM TASK LIST

  • Evaluate Build Error
  • Provide build guidance
  • Create Bug Report
@jmjatlanta
Copy link
Contributor

One suspect may be TMP. Look for over-generation of a template. Symptom would include increased compile time. And for a size change that large, I would guess the compile time difference would be noticeable.

Another obvious and higher probability suspect is something getting statically linked. As I believe you are implying, that should be diagnosed by looking at the CMakeLists.txt file. The tool ldd could be used across both binaries to make a comparison.

@abitmore
Copy link
Member Author

I've run ldd but no obvious difference was shown between test-4.0.4 and test-3.3.4.

One possible reason is the BSIP40 implementation which heavily uses templates.

@abitmore
Copy link
Member Author

It's clear that the main reason is the BSIP40 (custom active authorities) implementation. Among the intermediate files generated during building, the new libgraphene_protocol_custom_auths.a file is more than 200M, other big files e.g. *wallet.a, *protocol.a and *chain.a are much bigger than before.

Here listed the sizes of the .a files generated during building:

4.0                                             3.3
243423494 libgraphene_protocol_custom_auths.a <
94490488 libgraphene_wallet.a                 | 13270970 libgraphene_wallet.a
93290150 libgraphene_protocol.a               | 30389818 libgraphene_protocol.a
77684642 libgraphene_chain.a                  | 28626158 libgraphene_chain.a
47724598 libgraphene_app.a                    | 23459270 libgraphene_app.a
14158320 libgraphene_elasticsearch.a          | 3041124 libgraphene_elasticsearch.a
11773988 libfc.a                              | 11763484 libfc.a
9253250 libgraphene_account_history.a         | 1752730 libgraphene_account_history.a
8273058 libgraphene_delayed_node.a            | 2813498 libgraphene_delayed_node.a
7791290 libgraphene_net.a                     | 5239454 libgraphene_net.a
5758230 libgraphene_es_objects.a              | 1397412 libgraphene_es_objects.a
3768288 libgraphene_witness.a                 | 1233620 libgraphene_witness.a
2583446 libgraphene_market_history.a          | 1810726 libgraphene_market_history.a
2056060 libgraphene_utilities.a               | 2056052 libgraphene_utilities.a
1987568 libgraphene_debug_witness.a           | 738690 libgraphene_debug_witness.a
1124368 libgraphene_custom_operations.a       <
970874 libsecp256k1.a                         | 970858 libsecp256k1.a
377094 libgraphene_snapshot.a                   377094 libgraphene_snapshot.a
336524 libgraphene_db.a                         336524 libgraphene_db.a
238634 libgraphene_grouped_orders.a           | 237850 libgraphene_grouped_orders.a
178832 libeditline.a                          | 178784 libeditline.a
106592 libgraphene_api_helper_indexes.a       | 104290 libgraphene_api_helper_indexes.a
14868 libgraphene_egenesis_full.a             | 38617300 libgraphene_egenesis_full.a
7408 libgraphene_egenesis_none.a                7408 libgraphene_egenesis_none.a
4460 libgraphene_egenesis_brief.a               4460 libgraphene_egenesis_brief.a

I guess we have to accept it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants