fmtlib / fmt

A modern formatting library
https://fmt.dev
Other
20.86k stars 2.51k forks source link

Few questions about performance #4215

Closed kelbon closed 1 month ago

kelbon commented 1 month ago

First question: why copy_noinline ? Its for reducing binary size? I think it may break many optimizations

Second question: Isn't it more efficient to make memcpy, when possible here ? Compiler do not optimizes this loop into memcpy: https://godbolt.org/z/vGPE8jjxT

https://github.com/fmtlib/fmt/blob/4daa3d591f6715671e6716a298ec39f0a34058c5/include/fmt/base.h#L1988