Most efficient data copy process

I would like to know which IEC code results in the most efficient data copy process. Why this is the case? Imagine we need to copy data from one structure to the other in structured text. Possibilities:

                                               * structure_1:= structure_2;
                                               * Memory_Copy(structure_2,0,structure_1,0, count);
                                               * For loop (in case of byte array)

Extra question: What is meant with runtime system memory area ‘M’? Thanks, Sven

Hi Sven, Sorry for the delay - here is the answer (I am paraphrasing the answer from the experts):

The most efficient copy process is achieved using direct assignment, i.e. structure_1:= structure_2; If direct assignment is not possible e.g. due to different data types, then MEMORY_COPY can be used. For-next loops are the least efficient. M memory is a concept from “classic” PLCs and is no longer available in PLCnext Control devices. The reference to M memory in the documentation is an error will be removed.

~ Martin.