json icon indicating copy to clipboard operation
json copied to clipboard

Investigate opportunities for faster compilation

Open grisumbras opened this issue 3 years ago • 0 comments

This experiment claims that including boost/json.hpp results in build time of ~1500 ms, while including nlohmann/json.hpp — only ~900 ms. We could investigate this to see if there's anything we can do to decrease our compilation time footprint.

Note: the tests were conducted on Windows and NTFS is notoriously slow at opening files. This might be the main culprit, as Boost.Json was tested in header-only non-standalone mode, which means that all of Json headers, all of Json implementation files, and many Boost.Container, Boost.Config etc. headers where opened. Meanwhile, nlohman was a single header.

Meanwhile these tests claims that boost/json.hpp" _increases_ compilation by 271–553 ms while nlohmann/json.hpp` by 526–852 ms. The tests are conducted on Linux and also don't link (and don't include implementation files).

My current intuition is that the only thing we can actually do is create a special single merged header during builds.

grisumbras avatar Aug 07 '21 15:08 grisumbras