Algorithms for modern hardware?

后端 未结 5 685
死守一世寂寞
死守一世寂寞 2021-01-31 21:32

Once again, I find myself with a set of broken assumptions. The article itself is about a 10x performance gain by modifying a proven-optimal algorithm to account for virtual mem

5条回答
  •  一整个雨季
    2021-01-31 22:24

    You only need to re-examine your algorithms when your customers complain about the slowness of your program or it is missing critical deadlines. Otherwise focus on correctness, robustness, readability, and ease of maintenance. Until these items are achieved any performance optimization is a waste of development time.

    Page faults and disk operations may be platform specific. Always profile your code to see where the bottlenecks are. Spending time on these areas will produce the most benefits.

    If you're interested, along with page faults and slow disk operations, you may want to aware of:

    • Cache hits -- Data Oriented Design
    • Cache hits -- Reducing unnecessary branches / jumps.
    • Cache prediction -- Shrink loops so they fit into the processor's cache.

    Again, these items are only after quality has been achieved, customer complaints and a profiler has analyzed your program.

提交回复
热议问题