ui: Compile boost::signals2 only once #13634

pull MarcoFalke wants to merge 1 commits into bitcoin:master from MarcoFalke:Mf1807-uiSignals2Wrap changing 5 files +95 −34
  1. MarcoFalke commented at 1:36 pm on July 11, 2018: member

    ui is one of the modules that poison other modules with boost/signals2 headers. This moves the include to the cpp file and uses a forward declaration in the header.

    Locally this speeds up the incremental build (building everything that uses the ui module) with gcc by ~5% for me. Gcc uses ~5% less memory.

    Would be nice if someone could verify the numbers roughly.

    I presume the improvements will be more pronounced if the other models would stop exposing the boost header as well.

  2. MarcoFalke added the label Refactoring on Jul 11, 2018
  3. laanwj commented at 1:56 pm on July 11, 2018: member

    Concept ACK.

    Though, I wonder if we do this, it would make sense to move this away from boost::signals completely for the UI interface (registering interface objects as delegates instead) instead of working to hide boost::signals. But no strong opinion on that.

  4. practicalswift commented at 2:08 pm on July 12, 2018: contributor
    Concept ACK
  5. MarcoFalke commented at 9:18 pm on July 19, 2018: member
    This seemed like a straightforward refactor with a clear win. Not sure if the “registering interface objects as delegates instead” is as simple as that.
  6. DrahtBot commented at 8:14 pm on August 3, 2018: member
    • #10973 (Refactor: separate wallet from node by ryanofsky)
    • #10102 ([experimental] Multiprocess bitcoin by ryanofsky)

    If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

  7. in src/ui_interface.h:82 in fa15f97c03 outdated
    74@@ -72,43 +75,69 @@ class CClientUIInterface
    75         MSG_ERROR = (ICON_ERROR | BTN_OK | MODAL)
    76     };
    77 
    78+#define ADD_SIGNALS_DECL_WRAPPER(signal_name)                                              \
    79+    boost::signals2::connection signal_name##_connect(std::function<signal_name##Sig> fn); \
    80+    void signal_name##_disconnect(std::function<signal_name##Sig> fn);
    


    kallewoof commented at 4:35 am on August 7, 2018:
    OCD-nit: remove ending ; to avoid ;; when used
  8. in src/ui_interface.h:85 in fa15f97c03 outdated
    81+
    82     /** Show message box. */
    83-    boost::signals2::signal<bool (const std::string& message, const std::string& caption, unsigned int style), boost::signals2::last_value<bool> > ThreadSafeMessageBox;
    84+    bool  ThreadSafeMessageBox          (const std::string& message, const std::string& caption, unsigned int style);
    85+    using ThreadSafeMessageBoxSig = bool(const std::string& message, const std::string& caption, unsigned int style);
    86+    ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox);
    


    kallewoof commented at 4:38 am on August 7, 2018:

    Maybe overkill but

    0#define ADD_SIGNALS_DECL_WRAPPER(signal_name, rtype, args...) \
    1    rtype signal_name(args);\
    2    using signal_name##Sig = rtype(args);\
    3    [...]
    

    then e.g.

    0    ADD_SIGNALS_DECL_WRAPPER(ThreadSafeMessageBox, bool, const std::string& message, const std::string& caption, unsigned int style);
    

    MarcoFalke commented at 2:55 pm on August 7, 2018:
    Oh thanks! That makes the diff in the header file look a lot cleaner.
  9. kallewoof commented at 4:39 am on August 7, 2018: member
    utACK fa15f97c03f0235ed848f9a151dd47ac152adcec
  10. ui: Compile boost:signals2 only once fa5ce27385
  11. MarcoFalke force-pushed on Aug 7, 2018
  12. kallewoof approved
  13. kallewoof commented at 2:32 am on August 8, 2018: member
    re-utACK fa5ce27385bc60cdf6d9a4eeb2d32c916c9e07eb
  14. ken2812221 commented at 2:59 am on August 8, 2018: contributor
    utACK fa5ce27
  15. MarcoFalke merged this on Aug 13, 2018
  16. MarcoFalke closed this on Aug 13, 2018

  17. ken2812221 referenced this in commit ddc3ec92b0 on Aug 13, 2018
  18. MarcoFalke deleted the branch on Aug 13, 2018
  19. laanwj referenced this in commit 6f5372a171 on Aug 25, 2018
  20. Munkybooty referenced this in commit 8dc363033c on Jun 28, 2021
  21. Munkybooty referenced this in commit 6371b139e8 on Jun 28, 2021
  22. Munkybooty referenced this in commit c952bc40e1 on Jun 28, 2021
  23. Munkybooty referenced this in commit 5ce57423ae on Jun 28, 2021
  24. Munkybooty referenced this in commit acc5944a2e on Jun 28, 2021
  25. Munkybooty referenced this in commit 36f6503543 on Jun 28, 2021
  26. Munkybooty referenced this in commit ada8adde89 on Jun 28, 2021
  27. Munkybooty referenced this in commit 8904725c02 on Jun 28, 2021
  28. Munkybooty referenced this in commit 790c77833d on Jun 29, 2021
  29. Munkybooty referenced this in commit 8ac2649219 on Jun 29, 2021
  30. Munkybooty referenced this in commit d61655470e on Jun 29, 2021
  31. Munkybooty referenced this in commit b5e608ad02 on Jun 29, 2021
  32. Munkybooty referenced this in commit 3d05f2af99 on Jun 29, 2021
  33. Munkybooty referenced this in commit e86ea611d4 on Jun 29, 2021
  34. Munkybooty referenced this in commit 1fcbf78864 on Jun 29, 2021
  35. Munkybooty referenced this in commit 89719270d1 on Jun 29, 2021
  36. Munkybooty referenced this in commit 6a9ff49e21 on Jun 29, 2021
  37. MarcoFalke locked this on Sep 8, 2021

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-06-02 01:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me