Re: libstdc++: Turn memmove to memcpy in vector reallocations

2023-11-23 Thread Jonathan Wakely
On Tue, 21 Nov 2023 at 18:11, Marc Glisse wrote: > > On Tue, 21 Nov 2023, Jonathan Wakely wrote: > > > CC Marc Glisse who added the relocation support. He might recall why > > we use memmove when all uses are for newly-allocated storage, which > > cannot overlap the existing storage. > > Going bac

Re: libstdc++: Turn memmove to memcpy in vector reallocations

2023-11-21 Thread Marc Glisse
On Tue, 21 Nov 2023, Jonathan Wakely wrote: CC Marc Glisse who added the relocation support. He might recall why we use memmove when all uses are for newly-allocated storage, which cannot overlap the existing storage. Going back a bit: https://gcc.gnu.org/pipermail/gcc-patches/2019-April/5206

Re: libstdc++: Turn memmove to memcpy in vector reallocations

2023-11-21 Thread Jonathan Wakely
On Tue, 21 Nov 2023 at 16:24, Jan Hubicka wrote: > > Hi, > this patch turns memmove to memcpy where we can and also avoids extra > guard checking if block is non-empty. This does not show as performance > improvement in my push_back micro-benchmark because vector rellocation > does not happen tha

libstdc++: Turn memmove to memcpy in vector reallocations

2023-11-21 Thread Jan Hubicka
Hi, this patch turns memmove to memcpy where we can and also avoids extra guard checking if block is non-empty. This does not show as performance improvement in my push_back micro-benchmark because vector rellocation does not happen that often. In general, however, we optimize memcpy better then m