Producing the fastest possible executable

后端 未结 10 2223
滥情空心
滥情空心 2021-02-06 15:55

I have a very large program which I have been compiling under visual studio (v6 then migrated to 2008). I need the executable to run as fast as possible. The program spends most

10条回答
  •  庸人自扰
    2021-02-06 16:39

    Check which /precision mode you are using. Each one generates quite different code and you need to choose based on what accuracy is required in your app. Our code needs precision (geometry, graphics code) but we still use /fp:fast (C/C++ -> Code generation options).

    Also make sure you have /arch:SSE2, assuming your deployment covers processors that all support SSE2. This will result is quite a big difference in performance, as compile will use very few cycles. Details are nicely covered in the blog SomeAssemblyRequired

    Since you are already profiling, I would suggest loop unrolling if it is not happening. I have seen VS2008 not doing it more frequently (templates, references etc..)

    Use __forceinline in hotspots if applicable.

    Change hotspots of your code to use SSE2 etc as your app seems to be compute intense.

提交回复
热议问题