5 Dec
2019
5 Dec
'19
4:16 p.m.
Phil Endecott wrote:
Results will depend on the architecture but I found that for N < 64 it was probably always best to copy_all(). For N==255, time for copy_all() and copy_size() is about equal when the container is half full.
Things are more complicated for operator== because of the unused bytes. It would be necessary to initialise everything to 0 and maintain that during e.g. erase() and assign(). I haven't tried to benchmark that but I suspect the trade-off would be similar.
This is an interesting observation because constexpr support requires the array to be initialized to 0. So if we can justify this as actually being faster for N < some value, we might as well do it.