memcpy
is likely to be the fastest way you can copy bytes around in memory. If you need something faster – try figuring out a way of not copying things around, e.g. swap pointers only, not the data itself.
More Related Contents:
- optimized sum of an array of doubles in C [duplicate]
- Improve INSERT-per-second performance of SQLite
- Why does the order of the loops affect performance when iterating over a 2D array?
- Is it safe to read past the end of a buffer within the same page on x86 and x64?
- Trying to understand gcc option -fomit-frame-pointer
- Why is this code using strlen heavily 6.5x slower with GCC optimizations enabled?
- memcpy() vs memmove()
- Matrix multiplication: Small difference in matrix size, large difference in timings
- Which ordering of nested loops for iterating over a 2D array is more efficient [duplicate]
- Is it faster to count down than it is to count up?
- What is the fastest way to swap values in C?
- Loop with function call faster than an empty loop
- Why vectorizing the loop does not have performance improvement
- How to do unsigned saturating addition in C?
- Efficient 4×4 matrix vector multiplication with SSE: horizontal add and dot product – what’s the point?
- read line by line in the most efficient way *platform specific*
- No performance gain after using openMP on a program optimize for sequential running
- When is assembly faster than C? [closed]
- memcpy vs assignment in C
- AVX/SSE version of xorshift128+
- Why is memcmp so much faster than a for loop check?
- How does the CPU cache affect the performance of a C program
- why does GCC __builtin_prefetch not improve performance?
- Concatenating strings in C, which method is more efficient?
- Very fast memcpy for image processing?
- Faster approach to checking for an all-zero buffer in C?
- Inline function v. Macro in C — What’s the Overhead (Memory/Speed)?
- Is x += 1 more efficient than x = x + 1?
- Why vectorizing the loop over 64-bit elements does not have performance improvement over large buffers?
- How much overhead can the -fPIC flag add?