Which kind of data organization using C arrays makes fastest code and why?

前端 未结 3 1499
走了就别回头了
走了就别回头了 2021-01-15 00:15

Given following data, what is the best way to organize an array of elements so that the fastest random access will be possible?

Each element has some int number,

3条回答
  •  傲寒
    傲寒 (楼主)
    2021-01-15 00:37

    Impossible to say. As with any performance related test, the answer my vary by any one or more of your OS, your CPU, your memory, your compiler etc.

    So you need to test for yourself. Set your performance targets, measure, optimise, repeat.

提交回复
热议问题