How to check if app is cpu-bound or memory-bound?

前端 未结 2 488
野性不改
野性不改 2020-12-24 15:17

I\'ve got an application that does few computational CPU work, but mostly memory accesses (allocating objects and moving them around, there\'s few numeric or arithmetic code

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-24 16:05

    You could always profile your application to see where it spends most of the time.

    You can learn a lot about your application's behaviour and data access patterns this way.

    If you are using Linux, you have a wide range of available tools for profiling, like:

    • OProfile
    • sysprof
    • valgrind + kcachegrind

    EDIT:

    For a more exact measurement of the processor performance as well as memory accesses, you could also try the AMD CodeAnalyst Performance Analyzer. Here are instructions on how to use it with Intel processors, though I haven't tried it myself.

    Another tool that you might also find useful is the Intel Performance Tuning Utility.

提交回复
热议问题