$ size lib/MaRC/.libs/libMaRC_la-Mercator.o
text data bss dec hex filename
3339 168 0 3507 db3 lib/MaRC/.libs/libMaRC_la-Mercator.o
In this case, the source file did not perform any spdlog based logging, and merely included <MaRC/Log.h> to pull in the MaRC logging function templates that are implemented in terms of spdlog. The function templates in question aren't used in the source file, meaning the observed increase in object file size should be brought on by including <spdlog/spdlog.h>.
With Spdlog
$ size lib/MaRC/.libs/libMaRC_la-Mercator.o
text data bss dec hex filename
61074 3961 1240 66275 102e3 lib/MaRC/.libs/libMaRC_la-Mercator.o
With spdlog we go from a total binary size of 3507 bytes to 66275.
Expected behavior
Some increase in binary size is expected, but the order of magnitude increase was unexpected. Ideally, the binary size should not increase so much.
Desktop (please complete the following information):
OS: Linux 64-bit
Compiler: g++ 7.3
Additional context
See the related question I posted to the spdlog repository at gabime/spdlog#774.
Assuming the size increase caused by using spdlog can't addressed any time soon, switching to simple logging directly through fmtlib is probably the better way to go.
Describe the bug MaRC Object file sizes corresponding to source files that use the new spdlog based logging have increased significantly.
To Reproduce Steps to reproduce the behavior:
<MaRC/Log.h>
to pull in spdlog:Without Spdlog
In this case, the source file did not perform any spdlog based logging, and merely included
<MaRC/Log.h>
to pull in the MaRC logging function templates that are implemented in terms of spdlog. The function templates in question aren't used in the source file, meaning the observed increase in object file size should be brought on by including<spdlog/spdlog.h>
.With Spdlog
With spdlog we go from a total binary size of 3507 bytes to 66275.
Expected behavior Some increase in binary size is expected, but the order of magnitude increase was unexpected. Ideally, the binary size should not increase so much.
Desktop (please complete the following information):
Additional context See the related question I posted to the spdlog repository at gabime/spdlog#774.