How to increase performance of memcpy

后端 未结 8 2094
春和景丽
春和景丽 2020-12-04 07:11

Summary:

memcpy seems unable to transfer over 2GB/sec on my system in a real or test application. What can I do to get faster memory-to-memory copies?

Full d

8条回答
  •  伪装坚强ぢ
    2020-12-04 07:57

    One source I would recommend you read is MPlayer's fast_memcpy function. Also consider the expected usage patterns, and note that modern cpus have special store instructions which let you inform the cpu whether or not you will need to read back the data you're writing. Using the instructions that indicate you won't be reading back the data (and thus it doesn't need to be cached) can be a huge win for large memcpy operations.

提交回复
热议问题