Earlier quoted context omitted.
I thought memcpy would have launched some sort of built-in mechanism Where did you get this impression?
I'd expect memcpy calls to turn into builtin_memcpy and then into raw loads/stores for known small N and a call into compiler-rt for unknown or large N. If it doesn't, patches to do that for your architecture are likely appreciated.
Going faster than memcpy
81–83 of 83 posts
Re: Going faster than memcpy
#82Thought about zero-copy IPC recently. In order to avoid memcopy for the complete chain, I guess it would be best if the sender allocates its payload directly on the shared memory when it’s created. Is this a standard thing in such optimized IPC and which libraries offer this?
I've been meaning to look at Iceoryx as a way to wrap this. Pytorch multiprocessing queues work this way, but it is hard for the sender to ensure the data is already in shared memory, so it often has a copy. It is also common for buffers to not be reused, so that can end up a bottleneck, but it can, in principle, be limited by the rate of sending fds.
Re: Going faster than memcpy
#83> Since the loop copies data pointer by pointer, it can handle the case of overlapping data. I don't think this loop does the right thing if destination points somewhere into source. It will start overwriting the non-copied parts of source.