Memcpy

Memcpy() is a C standard library function used for copying a block of memory bytes from one place to another.

Memmove

Memmove() is a C standard library function to copy a block of memory

Slower 2x server

Quality Example
Faster

"From reading other so questions such as this or this gives the impression that memcpy should work faster than memmove and intuitively this should be so"

from question "Unexpected performance from memcpy and memmove"

"The question is about is there really any platform where memcpy is faster than memmove"

from question "In what platform memmove and memcpy can have significant performance difference?"

2x faster

"Edit memmove is 2x faster than memcpy on the server"

from question "Poor memcpy Performance on Linux"

Slower std

"Std memmove may be very slightly slower than std memcpy emphasis added because it has to first check whether the source and target ranges overlap"

from question "Performance of memmove compared to memcpy twice?"

Slower

"This means that memmove might be very slightly slower than memcpy as it cannot make the same assumptions"

from question "What is the difference between memmove and memcpy?"

"Why is memcpy so much slower than memmove or hand rolled copy on the server"

from question "Poor memcpy Performance on Linux"

"Why does memcpy perform slower than memmove on my system"

from question "Unexpected performance from memcpy and memmove"

"Bad news is that the asmlib version of memmove is slower than the glibc version it is now running at the 300ms mark on par with the glibc version of memcpy"

from question "Poor memcpy Performance on Linux"

"And it said memmove might be very slightly slower than memcpy"

from question "Performance of memmove compared to memcpy twice?"

"Memcpy is still a little bit slower than memmove"

from question "Why is memmove faster than memcpy?"

None similiar functions

Quality Example
Faster

"On some arm platform im working on memmove was 3 times faster than memcpy for short unalligned load"

from question "Which one to use - memmove() or memcpy() - when buffers don't overlap?"

"So in what platform and how memcpy can be significantly faster than memmove if there is none why providing two similiar functions instead of just memmove and lead to a lots of bug"

from question "In what platform memmove and memcpy can have significant performance difference?"

Memory answers sophisticated

Quality Example
More efficient

"As an aside my c c++ is rusty but is not memcpy more efficient than memmove if you know you don t have overlapping memory"

from question "Copying only a part of a buffer from native code to Java using JNI"

More sophisticated

"As already pointed out in other answers memmove is more sophisticated than memcpy such that it accounts for memory overlaps"

from question "Memcpy() vs memmove()"

Others

Quality Example
Faster

"If you know buffers cannot overlap memcpy is fine and may in any given library use optimizations that allow it to be faster than memmove"

from question "Memmove doesn't move"

Greater

"It is entirely possible that in most implementations the cost of a memmove function call will not be significantly greater than memcpy in any scenario in which the behavior of both is defined"

from question "What are real significant cases when memcpy() is faster than memmove()?"

Slower

"Memmove on the laptop runs slower than memcpy but oddly enough runs at the same speed as the memmove on the server"

from question "Poor memcpy Performance on Linux"

"While memmove will be only slightly slower than memcpy due to the assumptions it needs to make about the source and destination in memcpy they cannot overlap it should still be far superior to any standard loop"

from question "Memmove vs. copying individual array elements"

More

"Note that memmove has more overhead than memcpy because it has to determine which direction of copying is safe"

from question "C: Memcpy vs Shifting: Whats more efficient?"

"Memcpy is more efficient than memmove. in general use memmove only if you have to"

from question "Fastest way to copy small - medium chunks of memory in C++"

Cache friendlier

"In addition as mats petersson said memmove is cache friendlier than memcpy"

from question "Why is memmove faster than memcpy?"

Back to Home
Data comes from Stack Exchange with CC-BY-SA-3.0