Producing the fastest possible executable

后端 未结 10 2269
滥情空心
滥情空心 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:48

    You say the program is very large. That tells me it probably has many classes in a hierarchy.

    My experience with that kind of program is that, while you are probably assuming that the basic structure is just about right, and to get better speed you need to worry about low-level optimization, chances are very good that there are large opportunities for optimization that are not of the low-level kind.

    Unless the program has already been tuned aggressively, there may be room for massive speedup in the form of mid-stack operations that can be done differently. These are usually very innocent-looking and would never grab your attention. They are not cases of "improve the algorithm". They are usually cases of "good design" that just happen to be on the critical path.

    • Unfortunately, you cannot rely on profilers to find these things, because they are not designed to look for them.

    This is an example of what I'm talking about.

提交回复
热议问题