visual studio 2017启动/无调试性能差异

时间:2023-01-09 03:30:05

I'm new to visual studio. I created a console application in vs2017 to test the performance of a library, the code is very simple, something like

我是视觉工作室的新手。我在vs2017中创建了一个控制台应用程序来测试库的性能,代码非常简单,类似于

start stopwatch
insert a bunch of elements to a list. 
stop stopwatch
print out the time used

The strange thing is that when I run it within visual studio 2017, the time used is drastically smaller when running under "start without debug", i.e control+f5, comparing to "start with debug". I wonder what is causing the difference and which number should I use as a benchmark once I deployed this console app to cloud.

奇怪的是,当我在visual studio 2017中运行时,在“无需调试启动”下运行时所用的时间大大减少,即控制+ f5,与“启动调试”相比。我想知道造成这种差异的原因是什么,一旦我将这个控制台应用程序部署到云,我应该使用哪个数字作为基准。

Thanks.

1 个解决方案

#1


0  

Running on a development/developer machine cannot be considered as a benchmark for performance measurement. The best practice is to have a performance test[preferably automated] which is executed regularly on a machine which is as close as possible to your production environment. The test should capture the time taken for the use cases that you are interested in bench marking.

在开发/开发人员机器上运行不能被视为性能测量的基准。最佳实践是进行性能测试[最好是自动化],该测试在尽可能接近您的生产环境的机器上定期执行。测试应该捕获您对基准测试感兴趣的用例所花费的时间。

#1


0  

Running on a development/developer machine cannot be considered as a benchmark for performance measurement. The best practice is to have a performance test[preferably automated] which is executed regularly on a machine which is as close as possible to your production environment. The test should capture the time taken for the use cases that you are interested in bench marking.

在开发/开发人员机器上运行不能被视为性能测量的基准。最佳实践是进行性能测试[最好是自动化],该测试在尽可能接近您的生产环境的机器上定期执行。测试应该捕获您对基准测试感兴趣的用例所花费的时间。