openbmc / bmcweb

A do everything Redfish, KVM, GUI, and DBus webserver for OpenBMC
Apache License 2.0
163 stars 135 forks source link

Build bmcweb in multiple compile units #102

Closed edtanous closed 1 year ago

edtanous commented 5 years ago

bmcweb is currently built as one giant compile unit. This is due to a couple of reasons:

  1. crow was a header only library when this project started, and therefore required a recompile for every place it was included, which was every file. This lead to a lot of duplicated functions, and bloated compile times overall.
  2. boost beast is template heavy, very slow to compile and was a majority of the actual compile time for bmcweb. The code bmcweb contains was only a small portion of the total build, and at the time there was no way to separate boost::beast. Separating the compile units netted no significant build time reductions.

In the meantime, a couple things have happened. Crow code has been essentially dropped at this point, which makes it moot. bmcweb seems to be getting a lot more handler code. This is increasing the build times for the non-core components. Also, boost beast in 1.70 will gain the BOOST_BEAST_SEPARATE_COMPILATION flag, which allows all of beast to be built in a separate compile unit.

Because of those facts, we should move bmcweb to a more conventional, multi-compile-unit build. The main goal of this is to decrease the incremental build time, with the hope that every incremental build will only require a recompile of the changed units, and a relink (which is slow anyway).

edtanous commented 1 year ago

This is now documented in the repository at

https://raw.githubusercontent.com/openbmc/bmcweb/master/HEADERS.md

No reason to keep this bug open, as we should rely on the above as the source of truth.