Why does the speed of memcpy() drop dramatically every 4KB?

后端 未结 3 2168
日久生厌
日久生厌 2020-12-04 06:55

I tested the speed of memcpy() noticing the speed drops dramatically at i*4KB. The result is as follow: the Y-axis is the speed(MB/second) and the X-axis is the

3条回答
  •  孤城傲影
    2020-12-04 07:09

    Since you are looping many times, I think arguments about pages not being mapped are irrelevant. In my opinion what you are seeing is the effect of hardware prefetcher not willing to cross page boundary in order not to cause (potentially unnecessary) page faults.

提交回复
热议问题