-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Reduce library size #2299
Comments
7.1 is ~20k bigger because of adding Dragonbox (0c8ffe9). Maybe we can reuse powers of 10 table between Grisu and Dragonbox. |
Most of the regression happened between 7.1.0 and 7.1.1 so should be easy to track down. |
The regression between 7.1.0 and 7.1.1 was to preserve ABI compatibility (4081b2f) and is fixed now. |
~30k regression was caused by b268f88. |
Following #2293, I would suggest enabling set (CMAKE_CXX_VISIBILITY_PRESET hidden)
set (CMAKE_VISIBILITY_INLINES_HIDDEN ON) $ du -h build-before/libfmt.so.7.1.4
244K
$ du -h build-after/libfmt.so.7.1.4
212K I can provide a PR. |
Good idea but I would suggest using target properties instead of global CMake flags.
Please do. |
With b268f88 regression fixed:
|
CMake target properties would not provide any benefit here. On contrary, users will not be able to override the default choice by passing |
OK, just make sure that it works well with fmt used as a subproject, i.e. something like Line 60 in 18af1dc
|
Brag time 😉 Some of the regressions can be found here - https://alexezeder.github.io/fmt_bnchmrk/ |
This is amazing, thanks for putting it together. |
After 5a2b88f:
|
This is slightly smaller than 7.1.0 so I think it's good enough and we could look at floating point separately. |
Here are results with LTO and -Os:
|
Need to revisit library size optimizations (https://www.zverovich.net/2020/05/21/reducing-library-size.html) since there was a bit of a regression compared to 7.0:
For comparison 7.0 generates
with the latest clang and libc++. Looks like some of the regression is due to newer clang and standard library.
The text was updated successfully, but these errors were encountered: