Why does my program run way faster when I enable profiling?

前端 未结 7 1955
借酒劲吻你
借酒劲吻你 2020-12-06 00:58

I have a program that\'s running pretty slowly (takes like 20 seconds even on release) so, wanting to fix it, I tried to use Visual Studio\'s built in profiler. However, whe

7条回答
  •  旧时难觅i
    2020-12-06 01:29

    That sounds a lot like a Heisenbug.

    They really happen, and they can be painful to uncover.

    Your best solution in my experience is to change how you are profiling -- possibly several ways -- until the bug disappears.

    Use different profilers. Try adding timing code instead of using a profiler.

提交回复
热议问题