Most std::string
implementations (GCC included) use small string optimization. E.g. there\'s an answer discussing this.
Today, I decided to check at what po
One of your flags is:
--with-default-libstdcxx-abi=gcc4-compatible
and GCC4 does not support small string optimzation.
GCC5 started supporting it. isocpp states:
A new implementation of std::string is enabled by default, using the small string optimization instead of copy-on-write reference counting.
which supports my claim.
Moreover, Exploring std::string mentions:
As we see, older libstdc++ implements copy-on-write, and so it makes sense for them to not utilize small objects optimization.
and then he changes context, when GCC5 comes in play.