{"id":274256,"date":"2016-02-15T08:39:02","date_gmt":"2016-02-15T05:39:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274256"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274256","title":{"rendered":"\u0417\u0430\u043c\u0435\u0440\u044f\u0435\u043c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e BenchmarkDotNet"},"content":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cca\/849\/7b4\/cca8497b4b5143c3b00ffab8a8401f40.jpg\" alt=\"image\" align=\"left\"\/>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u041d\u0435\u0434\u0435\u043b\u044e \u043d\u0430\u0437\u0430\u0434 \u044f \u0432 \u0442\u0440\u0435\u0442\u0438\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\\\u0437\u0430\u043f\u0443\u0441\u043a\u0430 .NET \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 <a href=\"https:\/\/github.com\/PerfDotNet\/BenchmarkDotNet\">BenchmarkDotNet<\/a>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0439, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u0447\u0442\u043e \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044e.<\/p>\n<p>  \u041f\u043e\u0434 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u043c \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430(\u043e\u0432). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0440\u0443\u043a\u0430\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Release \u0431\u0438\u043b\u0434, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u00ab\u0437\u0430\u043c\u0435\u0440\u044f\u044e\u0449\u0438\u0439\u00bb \u043c\u0435\u0442\u043e\u0434, \u0432 \u043d\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0443\u0441\u043e\u0440, \u0441\u0442\u0430\u0432\u0438\u043c StopWatch \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0435\u0432, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u00ab\u0442\u0438\u043a\u0430\u00bb StopWatch, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 (\u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043b\u043b\u0438\u043e\u043d), \u0434\u0435\u043b\u0438\u043c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0438\u0437 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0440\u0435\u043c\u044f \u00ab\u0445\u043e\u043b\u043e\u0441\u0442\u043e\u0433\u043e\u00bb \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439). <\/p>\n<p>  <a name=\"habracut\"><\/a><\/p>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e, \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e, \u0438 \u0435\u0441\u043b\u0438 \u0441 \u043d\u0438\u043c\u0438 \u0435\u0449\u0435 \u043c\u043e\u0436\u043d\u043e \u0436\u0438\u0442\u044c, \u0442\u043e \u0441 \u0437\u0430\u043c\u0435\u0440\u0430\u043c\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0437\u043d\u043e\u0439 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b (x86\\x64) \u0438 \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u043c\u043f\u0438\u043b\u044f\u0442\u043e\u0440\u043e\u0432 \u0432\u0441\u0435 \u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u0441\u044f \u0441\u043e\u0432\u0441\u0435\u043c \u043f\u043b\u043e\u0445\u043e (\u043f\u0440\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435 <a href=\"https:\/\/www.youtube.com\/watch?v=1B6RRV509Ds\">\u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432<\/a> \u0438 <a href=\"https:\/\/www.youtube.com\/watch?v=RL21wPsiy3o\">\u0434\u0435\u0442\u0430\u043b\u0438<\/a> <a href=\"http:\/\/www.youtube.com\/watch?v=mnPJZxm2yyw\">\u043c\u0438\u043a\u0440\u043e\u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438<\/a> \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043e\u0434\u0438\u043d \u0438\u0437 \u0430\u0432\u0442\u043e\u0440\u043e\u0432 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u2014 \u0410\u043d\u0434\u0440\u0435\u0439  <a href=\"https:\/\/habrahabr.ru\/users\/dreamwalker\/\" class=\"user_link\">DreamWalker<\/a> \u0410\u043a\u0438\u043d\u044c\u0448\u0438\u043d). \u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0433\u0430\u0434\u0430\u0442\u044c\u0441\u044f, BenchmarkDotNet \u0431\u0435\u0440\u0435\u0442 \u0437\u0430\u0431\u043e\u0442\u0443 \u043e\u0431 \u044d\u0442\u0438\u0445 \u0434\u0435\u0442\u0430\u043b\u044f\u0445 \u043d\u0430 \u0441\u0435\u0431\u044f. <\/p>\n<h4>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430<\/h4>\n<p>  Nuget \u043f\u0430\u043a\u0435\u0442, \u043d\u0438\u043a\u0430\u043a\u0438\u0445 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0435\u0439; \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043f\u0443\u0431\u043b\u0438\u043a\u0430\u0446\u0438\u0438 \u0441\u0442\u0430\u0442\u044c\u0438 \u0432\u0435\u0440\u0441\u0438\u044f v0.9.1. <\/p>\n<h4>\u041f\u0440\u043e\u0441\u0442\u0435\u0439\u0448\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440<\/h4>\n<p>  \u041f\u0435\u0440\u0432\u044b\u043c \u0434\u0435\u043b\u043e\u043c \u044f \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u00ab\u043d\u0430 \u0432\u0448\u0438\u0432\u043e\u0441\u0442\u044c\u00bb.    <\/p>\n<pre><code class=\"cs\">    public class TheEasiestBenchmark     {         [Benchmark(Description = &quot;Summ100&quot;)]         public int Test100()         {             return Enumerable.Range(1, 100).Sum();         }          [Benchmark(Description = &quot;Summ200&quot;)]         public int Test200()         {             return Enumerable.Range(1, 200).Sum();         }     }      [TestClass]     public class UnitTest1     {         [TestMethod]         public void TestMethod1()         {                         BenchmarkRunner.Run&lt;TheEasiestBenchmark&gt;();         }     } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u0434\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043d\u0430\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0430\u0442\u0440\u0438\u0431\u0443\u0442 [Benchmark(Description= \u00abTestName\u00bb)], \u0438 \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043a\u043e\u0434 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u0438\u043b\u0438 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435. \u0422\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043c\u0435\u0442\u043e\u0434\u0443 \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u0438: \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u043f\u0443\u0431\u043b\u0438\u0447\u043d\u044b\u043c (\u0438\u043d\u0430\u0447\u0435 \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u043d\u0435 \u0431\u0443\u0434\u0435\u0442) \u0438 \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 (\u0438\u043d\u0430\u0447\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435). \u041f\u043e\u0441\u043b\u0435 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0438\u044f \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0432 \u043a\u043e\u043d\u0441\u043e\u043b\u0438 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u044b\u0439 \u043e\u0442\u0447\u0435\u0442 \u043e \u0442\u0435\u0441\u0442\u0430\u0445, \u0441 \u043e\u0431\u043e\u0431\u0449\u0430\u044e\u0449\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435\u0439 \u0432 \u043a\u043e\u043d\u0446\u0435. <\/p>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Median<\/th>\n<th> StdDev<\/th>\n<\/tr>\n<tr>\n<td> Summ100<\/td>\n<td> 1.0282 us<\/td>\n<td> 0.1071 us<\/td>\n<\/tr>\n<tr>\n<td> Summ200<\/td>\n<td> 1.9573 us<\/td>\n<td> 0.0648 us<\/td>\n<\/tr>\n<\/table>\n<p>  \u041f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0432 \u043d\u0435\u0439 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430, \u043c\u0435\u0434\u0438\u0430\u043d\u0430, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0435 \u043e\u0442\u043a\u043b\u043e\u043d\u0435\u043d\u0438\u0435. \u0415\u0441\u043b\u0438 \u043d\u0435 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e \u00abDescription\u00bb \u0432 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0435 [Benchmark] \u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0435 Method \u0432\u044b\u0441\u0432\u0435\u0442\u0438\u0442\u0441\u044f \u0438\u043c\u044f \u043c\u0435\u0442\u043e\u0434\u0430. \u041a\u0441\u0442\u0430\u0442\u0438, \u0441\u0442\u0440\u043e\u043a\u0438 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0442\u0441\u044f \u0441\u043e\u0433\u043b\u0430\u0441\u043d\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0430 Description (\u0438\u043c\u0435\u043d\u0430\u043c \u043c\u0435\u0442\u043e\u0434\u043e\u0432). \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0447\u0435\u043d\u043d\u043e\u0435 \u0432 \u043c\u0435\u0442\u043e\u0434\u0435 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u0442 \u0437\u0430\u043c\u0435\u0440 (\u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430).<\/p>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043c\u0435\u0440\u0430 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0439 \u00ab\u0437\u0430\u043c\u0435\u0440\u044f\u044e\u0449\u0438\u0439\u00bb \u043c\u0435\u0442\u043e\u0434:  <\/p>\n<pre><code class=\"cs\">private double SomeBusinessLogic(int arg){ ... }  [Benchmark(Description = &quot;Summ100&quot;)] public void MeasurmentMethod() {     SomeBusinessLogic(42);     } <\/code><\/pre>\n<h4>\u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432<\/h4>\n<p>  \u041a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 Config. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u043c\u0430\u043b\u044b\u0435: \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f\\\u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u044b\\\u0434\u0436\u0438\u0442\u0442\u0435\u0440\u0430, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0432\u044b\u0432\u043e\u0434\u0430, \u043b\u043e\u0433\u0433\u0435\u0440\u043e\u0432, \u0430\u043d\u0430\u043b\u0438\u0437\u0430\u0442\u043e\u0440\u044b\u2026 \u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043a\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430 <a href=\"https:\/\/github.com\/PerfDotNet\/BenchmarkDotNet\">github<\/a>.<\/p>\n<p>  \u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438: \u0432\u0435\u0448\u0430\u0435\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Config \u043d\u0430 \u043a\u043b\u0430\u0441\u0441, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 Benchmark-\u043c\u0435\u0442\u043e\u0434\u044b, \u0438 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438. \u0422\u0430\u043a, \u0435\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0443\u0432\u0438\u0434\u0435\u0442\u044c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0432 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u0435, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:<\/p>\n<pre><code class=\"cs\">[Config(&quot;columns=Max&quot;)] public class TheEasiestBenchmark {     [Benchmark(Description = &quot;Summ100&quot;)]     public int Test100()     {          return Enumerable.Range(1, 100).Sum();     } }  <\/code><\/pre>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Median<\/th>\n<th> StdDev<\/th>\n<th> Max<\/th>\n<\/tr>\n<tr>\n<td> Summ100<\/td>\n<td> 1.0069 us<\/td>\n<td> 0.0124 us<\/td>\n<td> 1.0441 us<\/td>\n<\/tr>\n<\/table>\n<p>  \u0414\u0440\u0443\u0433\u043e\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043a\u043b\u0430\u0441\u0441-\u043d\u0430\u0441\u043b\u0435\u0434\u043d\u0438\u043a \u043e\u0442 ManualConfig, \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0442\u0438\u043f \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 Config. <\/p>\n<pre><code class=\"cs\">[Config(typeof(HabrExampleConfig))] public class TheEasiestBenchmark {     private class HabrExampleConfig : ManualConfig     {         public HabrExampleConfig()         {                             Add(StatisticColumn.Max); \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443                         }     }      [Benchmark(Description = &quot;Summ100&quot;)]     public int Test100()     {         return Enumerable.Range(1, 100).Sum();     } } <\/code><\/pre>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Median<\/th>\n<th> StdDev<\/th>\n<th> Max<\/th>\n<\/tr>\n<tr>\n<td> Summ100<\/td>\n<td> 1.0114 us<\/td>\n<td> 0.0041 us<\/td>\n<td> 1.0201 us<\/td>\n<\/tr>\n<\/table>\n<p>  \u0421 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0431\u043e\u043b\u044c\u0448\u0435 \u043a\u043e\u0434\u0430, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0436\u0435, \u043f\u0440\u0438 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0438 \u043a\u043b\u0430\u0441\u0441\u0430 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u0442 \u0430\u0432\u0442\u043e\u0434\u043e\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435: \u043f\u0440\u043e\u0449\u0435 \u043d\u0430\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0442\u044c, \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f.<\/p>\n<h5>\u041d\u0435\u043c\u043d\u043e\u0433\u043e \u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u0445<\/h5>\n<p>  \u041d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u043d\u0435\u043c\u0430\u043b\u043e, \u0438 \u043e\u043d\u0438 \u0440\u0430\u0437\u0434\u0435\u043b\u0435\u043d\u044b \u043f\u043e \u0442\u0438\u043f\u0430\u043c. <\/p>\n<p>  \u041f\u0435\u0440\u0432\u044b\u0439 \u0442\u0438\u043f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a \u2014 Job. \u041a\u0430\u043a \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0438\u0437 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438, \u043d\u0443\u0436\u0435\u043d \u0434\u043b\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: \u043e\u0436\u0438\u0434\u0430\u0435\u043c\u0430\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 (x64\\x86), \u0434\u0436\u0438\u0442\u0442\u0435\u0440, \u0440\u0430\u043d\u0442\u0430\u0439\u043c. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u0435\u0441\u043b\u0438 \u0432\u0430\u0441 \u043d\u0435 \u0443\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432 (\u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u044b\u0442\u0430\u0435\u0442\u0441\u044f \u043f\u043e\u0434\u043e\u0431\u0440\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u043f\u043e \u043a\u0440\u0438\u0442\u0435\u0440\u0438\u044f\u043c \u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c\\\u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430), \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0433\u0440\u0435\u0432\u043e\u0447\u043d\u044b\u0445 \u0438 \u0446\u0435\u043b\u0435\u0432\u044b\u0445 \u0437\u0430\u043f\u0443\u0441\u043a\u043e\u0432, \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0443\u043a\u0430\u0437\u0430\u0442\u044c \u0436\u0435\u043b\u0430\u0435\u043c\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u0440\u043e\u0433\u043e\u043d\u0430. \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u0431\u044b\u0442\u044c \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u044b\u043c \u0441 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043e\u043a\u0440\u0443\u0436\u0435\u043d\u0438\u044f: \u0435\u0441\u043b\u0438 \u043a\u043b\u0430\u0441\u0441 \u043b\u0435\u0436\u0438\u0442 \u0432 \u043f\u0440\u043e\u0435\u043a\u0442\u0435 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u043c \u043d\u0430 .NET 4.6, \u0430 \u043a\u043e\u043d\u0444\u0438\u0433 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043d \u043d\u0430 .NET 4.5, \u0432 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u043e\u0448\u0438\u0431\u043a\u0443 (\u0447\u0442\u043e, \u0432 \u043e\u0431\u0449\u0435\u043c, \u043b\u043e\u0433\u0438\u0447\u043d\u043e).<\/p>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0442\u0438\u043f \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a: \u0443\u0436\u0435 \u0437\u043d\u0430\u043a\u043e\u043c\u044b\u0439 \u043d\u0430\u043c Columns. \u041f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u0443\u044e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e. \u041f\u043e\u043b\u043d\u044b\u0439 \u0441\u043f\u0438\u0441\u043e\u043a \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043e\u043a \u0434\u043e\u0441\u0443\u0442\u043f\u0435\u043d \u0432 \u0440\u0430\u0437\u0434\u0435\u043b\u0435 Columns -&gt; default <a href=\"https:\/\/github.com\/PerfDotNet\/BenchmarkDotNet\">\u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438<\/a>. \u0412 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043a\u043e\u043b\u043e\u043d\u043a\u0438 \u0432\u0440\u043e\u0434\u0435 PropertyColumn.* (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, PropertyColumn.Runtime), StatisticColumn.* (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, StatisticColumn.Median). <\/p>\n<p>  \u041e\u0447\u0435\u0440\u0435\u0434\u043d\u043e\u0439 \u043f\u0443\u043d\u043a\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0435\u043a: Exporters. \u0423\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u043a\u0430\u043a\u0438\u0435 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b: html, txt, csv, R plots, \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0430 markdown \u0434\u043b\u044f SO, github. \u0422\u0430\u043a, \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f R \u0433\u0440\u0430\u0444\u0438\u043a\u043e\u0432 \u0438 csv \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430 \u0432 \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0442\u043e\u0440 MyConfig \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c Add(RPlotExporter.Default, CsvExporter.Default);<\/p>\n<p>  \u041a\u043b\u0430\u0441\u0441 \u0441\u043e \u0432\u0441\u0435\u043c\u0438 \u044d\u0442\u0438\u043c\u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430\u043c\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"cs\">internal class HabrExampleConfig : ManualConfig { \tpublic HabrExampleConfig () \t{ \t\tAdd(new Job {IterationTime = 1,WarmupCount = 1,TargetCount = 1}); \t\tAdd(StatisticColumn.Max); \t\tAdd(RPlotExporter.Default, CsvExporter.Default); \t} }  [Config(typeof(HabrExampleConfig ))] public class TheEasiestBenchmark{...} <\/code><\/pre>\n<p>  \u041f\u043e\u0447\u0442\u0438 \u0442\u0430\u043a\u0436\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0435\u0449\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u2014 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e\u0433\u043e \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438.   <\/p>\n<pre><code class=\"cs\">    [MyConfigSource]     public class TheEasiestBenchmark     {         private class MyConfigSourceAttribute : Attribute, IConfigSource         {             public IConfig Config { get; private set; }              public MyConfigSourceAttribute()             {                 Config = ManualConfig.CreateEmpty()                     .With(StatisticColumn.Max)                     .With(new Job {Platform = Platform.X64})                     .With(RPlotExporter.Default);             }         }          [Benchmark(Description = &quot;Summ100&quot;)]         public int Test100()         {             return Enumerable.Range(1, 100).Sum();         }     } <\/code><\/pre>\n<p>  \u041d\u0430\u0434\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0442\u0440\u0438 \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043b\u0438\u0448\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0447\u0442\u043e-\u0442\u043e \u043a \u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u0438. \u0422\u0430\u043a, \u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0435 \u043a\u043e\u043b\u043e\u043d\u043a\u0438 Method\\Median\\StdDev \u0431\u0443\u0434\u0443\u0442 \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c \u0432\u0441\u0435\u0433\u0434\u0430.<\/p>\n<p>  \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0442\u044c \u0432\u044b\u0432\u043e\u0434 (\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432), \u043c\u043e\u0436\u043d\u043e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u043e\u043c UnionRule.   <\/p>\n<pre><code class=\"cs\">    [Config(typeof(HabrExampleConfig))]     public class TheEasiestBenchmark     {         private class HabrExampleConfig : ManualConfig         {             public HabrExampleConfig()             {     \t        Add(PropertyColumn.Method, StatisticColumn.Max); \/\/ \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043b\u0438\u0448\u044c \u0438\u043c\u044f \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f                 Add(ConsoleLogger.Default); \/\/ \u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u044b\u0432\u043e\u0434 \u043d\u0430 \u043a\u043e\u043d\u0441\u043e\u043b\u044c                 UnionRule = ConfigUnionRule.AlwaysUseLocal; \/\/ \u041e\u0442\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u0441\u044f \u043e\u0442 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0433\u043e \u043a\u043e\u043d\u0444\u0438\u0433\u0430             }         }                  [Benchmark(Description = &quot;Summ100&quot;)]         public int Test100()         {             return Enumerable.Range(1, 100).Sum();         }     } <\/code><\/pre>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Max<\/th>\n<\/tr>\n<tr>\n<td> Summ100<\/td>\n<td> 1.0308 us<\/td>\n<\/tr>\n<\/table>\n<p>  \u0422\u0430\u043a\u043e\u0439 \u043f\u043e\u0434\u0445\u043e\u0434 \u043f\u0440\u0438\u0433\u043e\u0434\u0438\u0442\u0441\u044f \u0442\u0435\u043c, \u043a\u0442\u043e \u0436\u0435\u043b\u0430\u0435\u0442 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 \u0432 CI \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435, \u0438\u0431\u043e \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0433\u0435\u043d\u0435\u0440\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u0444\u0430\u0439\u043b\u044b \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u043c\u0438 \u0441\u043a\u043e\u0440\u0435\u0435 \u0432\u0441\u0435\u0433\u043e \u0431\u0443\u0434\u0443\u0442 \u043b\u0438\u0448\u043d\u0438\u043c\u0438.<\/p>\n<h4>\u0414\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0438\u0447\u0438<\/h4>\n<p>  <\/p>\n<h5>\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0442\u0435\u0441\u0442\u044b<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u044d\u043a\u0441\u043f\u0435\u0440\u0438\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u043c\u0435\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u043e \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0438 \u043c\u0435\u0442\u043e\u0434\u0430 \u043f\u0440\u0438 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430\u0445, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 Params.<br \/>  \u0422\u0430\u043a, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u0430 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0439 \u0441\u0438\u043c\u0432\u043e\u043b\u0430 \u2018a\u2019 \u0432 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438:<\/p>\n<pre><code class=\"cs\">        [Params(&quot;habrahabr&quot;, &quot;geektimes&quot;, &quot;toster&quot;, &quot;megamozg&quot;)]         public string arg;          [Benchmark(Description = &quot;Test&quot;)]         public int CountLetterAIncludings()         {             int res = 0;             for (int i = 0; i &lt; arg.Length; i++)             {                 if (arg[i] == 'a'){res++;}             }             return res;         } <\/code><\/pre>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Median<\/th>\n<th> StdDev<\/th>\n<th> arg<\/th>\n<\/tr>\n<tr>\n<td> Test<\/td>\n<td> 112.4087 ns<\/td>\n<td> 1.1556 ns<\/td>\n<td> geektimes<\/td>\n<\/tr>\n<tr>\n<td> Test<\/td>\n<td> 113.0916 ns<\/td>\n<td> 1.4137 ns<\/td>\n<td> habrahabr<\/td>\n<\/tr>\n<tr>\n<td> Test<\/td>\n<td> 104.3207 ns<\/td>\n<td> 4.2854 ns<\/td>\n<td> megamozg<\/td>\n<\/tr>\n<tr>\n<td> Test<\/td>\n<td> 80.3665 ns<\/td>\n<td> 0.4564 ns<\/td>\n<td> toster<\/td>\n<\/tr>\n<\/table>\n<h5>\u041e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430<\/h5>\n<p>  \u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u043c\u044b \u0436\u0435\u043b\u0430\u0435\u043c \u0443\u0437\u043d\u0430\u0442\u044c \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u0431\u0441\u043e\u043b\u044e\u0442\u043d\u044b\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0430 \u0442\u0435\u0441\u0442\u043e\u0432\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432, \u043d\u043e \u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u043c\u0435\u0442\u043e\u0434, \u0432\u0440\u0435\u043c\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u201c\u043d\u043e\u0440\u043c\u043e\u0439\u201d, \u0438 \u0438\u0437\u043c\u0435\u043d\u044f\u0435\u043c \u0435\u0433\u043e Benchmark \u0430\u0442\u0440\u0438\u0431\u0443\u0442, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0432 BaseLine \u0432 true.<\/p>\n<pre><code class=\"cs\">        [Benchmark(Description = &quot;Summ100&quot;)]         public int Test100()         {             return Enumerable.Range(1, 100).Sum();         }          [Benchmark(Description = &quot;Summ200&quot;, Baseline = true)]         public int Test200()         {             return Enumerable.Range(1, 200).Sum();         } <\/code><\/pre>\n<table>\n<tr>\n<th> Method<\/th>\n<th> Median<\/th>\n<th> StdDev<\/th>\n<th> Scaled<\/th>\n<\/tr>\n<tr>\n<td> Summ100<\/td>\n<td> 1.0113 us<\/td>\n<td> 0.0055 us<\/td>\n<td> 0.52<\/td>\n<\/tr>\n<tr>\n<td> Summ200<\/td>\n<td> 1.9516 us<\/td>\n<td> 0.0120 us<\/td>\n<td> 1.00<\/td>\n<\/tr>\n<\/table>\n<h4>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0436\u0435\u043b\u0430\u043d\u0438\u0435\\\u043f\u043e\u0442\u0440\u0435\u0431\u043d\u043e\u0441\u0442\u044c \u043a\u0430\u043a\u0438\u043c-\u043b\u0438\u0431\u043e \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u043e\u0438\u0437\u0432\u0440\u0430\u0449\u0430\u0442\u044c\u0441\u044f \u0441\u043e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u043e\u0439, \u0438\u043b\u0438 \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0441\u0432\u043e\u0439 Exporter, \u043a \u0412\u0430\u0448\u0438\u043c \u0443\u0441\u043b\u0443\u0433\u0430\u043c \u043a\u043b\u0430\u0441\u0441 Summary. \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u0435 \u0442\u0435\u0441\u0442 \u0432 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u043c \u0442\u0435\u0441\u0442\u0435   <\/p>\n<pre><code class=\"cs\">Summary result = BenchmarkRunner.Run&lt;TheEasiestBenchmark&gt;(); <\/code><\/pre>\n<p>  \u0438 \u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435\u0441\u044c \u0432\u0441\u0435\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u043a\u0430\u0436\u0434\u043e\u043c \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0435 <s>\u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043d\u043e \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u043e \u0438 \u0431\u0435\u0437 \u0421\u041c\u0421<\/s>.<br \/>  result.Benchmarks[index] \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e Job&#8217;e \u0438 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430\u0445, result.Reports[index] \u0445\u0440\u0430\u043d\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0438 \u0435\u0433\u043e \u0442\u0438\u043f\u0435 (\u043f\u0440\u043e\u0433\u0440\u0435\u0432\u043e\u0447\u043d\u044b\u0439\\\u0431\u043e\u0435\u0432\u043e\u0439). <\/p>\n<p>  \u041a\u0440\u043e\u043c\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 html, csv, txt \u0444\u043e\u0440\u043c\u0430\u0442\u0430\u0445, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0432 markdown \u0440\u0430\u0437\u043c\u0435\u0442\u043a\u0435 \u0438 \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 R png-\u0440\u0438\u0441\u0443\u043d\u043a\u0430\u0445. \u0422\u0430\u043a, \u0432\u0441\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0442\u0435\u0441\u0442\u043e\u0432 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0438\u0437 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 html \u0444\u0430\u0439\u043b\u043e\u0432.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u0440\u0438\u0441\u0443\u043d\u043a\u043e\u0432<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/745\/378\/0f6\/7453780f6dc640f793651bb91e16bd67.png\" alt=\"image\"\/><br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/fab\/72d\/326\/fab72d32609a4b1fa5e1038b6e671a4b.png\" alt=\"image\"\/>  <\/div>\n<\/div>\n<p>  \u041f\u043e\u0434\u044b\u0442\u043e\u0436\u0438\u0432\u0430\u044f \u0432\u044b\u0448\u0435\u0441\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u0435, BenchmarkDotNet \u0431\u0435\u0440\u0435\u0442 \u043d\u0430 \u0441\u0435\u0431\u044f \u0440\u0443\u0442\u0438\u043d\u043d\u044b\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u0440\u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 \u0438 \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0438\u0432\u0430\u0435\u0442 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u044b\u0435 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u0432 \u0446\u0435\u043d\u043e\u0439 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0441\u0438\u043b\u0438\u0439. \u0422\u0430\u043a \u0447\u0442\u043e, \u0435\u0441\u043b\u0438 \u0445\u043e\u0442\u0438\u0442\u0435 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0440\u0438\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0442\u043e\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0434\u043b\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u0432 \u0441 \u043c\u0430\u043b\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u0438\u043b\u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043a\u0440\u0430\u0441\u0438\u0432\u044b\u0439 \u0433\u0440\u0430\u0444\u0438\u043a \u0434\u043b\u044f \u043c\u0435\u043d\u0435\u0434\u0436\u043c\u0435\u043d\u0442\u0430 \u2014 \u0432\u044b \u0443\u0436\u0435 \u0437\u043d\u0430\u0435\u0442\u0435 \u0447\u0442\u043e \u0434\u0435\u043b\u0430\u0442\u044c. \ud83d\ude42               <\/p>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/277177\/\"> https:\/\/habrahabr.ru\/post\/277177\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cca\/849\/7b4\/cca8497b4b5143c3b00ffab8a8401f40.jpg\" alt=\"image\" align=\"left\"\/>\u0414\u043e\u0431\u0440\u044b\u0439 \u0434\u0435\u043d\u044c. \u041d\u0435\u0434\u0435\u043b\u044e \u043d\u0430\u0437\u0430\u0434 \u044f \u0432 \u0442\u0440\u0435\u0442\u0438\u0439 \u0440\u0430\u0437 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043b \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f\\\u0437\u0430\u043f\u0443\u0441\u043a\u0430 .NET \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u0432 <a href=\"https:\/\/github.com\/PerfDotNet\/BenchmarkDotNet\">BenchmarkDotNet<\/a>. \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043e\u043a\u0430\u0437\u0430\u043b\u0430\u0441\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0443\u0434\u043e\u0431\u043d\u043e\u0439, \u043d\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0435 \u043e\u0441\u0432\u0435\u0449\u0435\u043d\u043d\u043e\u0439 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435, \u0447\u0442\u043e \u044f \u0441\u0435\u0439\u0447\u0430\u0441 \u0438 \u0438\u0441\u043f\u0440\u0430\u0432\u043b\u044e.<\/p>\n<p>  \u041f\u043e\u0434 \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u043e\u043c \u044f \u043f\u043e\u0434\u0440\u0430\u0437\u0443\u043c\u0435\u0432\u0430\u044e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043c\u0435\u0442\u043e\u0434\u0430(\u043e\u0432). \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0431\u0435\u043d\u0447\u043c\u0430\u0440\u043a\u0430 \u0440\u0443\u043a\u0430\u043c\u0438. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c Release \u0431\u0438\u043b\u0434, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u00ab\u0437\u0430\u043c\u0435\u0440\u044f\u044e\u0449\u0438\u0439\u00bb \u043c\u0435\u0442\u043e\u0434, \u0432 \u043d\u0435\u043c \u0441\u043e\u0431\u0438\u0440\u0430\u0435\u043c \u043c\u0443\u0441\u043e\u0440, \u0441\u0442\u0430\u0432\u0438\u043c StopWatch \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u0438 \u0432 \u043a\u043e\u043d\u0446\u0435, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u043f\u0440\u043e\u0433\u0440\u0435\u0432, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434. \u0415\u0441\u043b\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0431\u044b\u0441\u0442\u0440\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u00ab\u0442\u0438\u043a\u0430\u00bb StopWatch, \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0439 \u043c\u0435\u0442\u043e\u0434 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 (\u043f\u0443\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u0442 \u043c\u0438\u043b\u043b\u0438\u043e\u043d), \u0434\u0435\u043b\u0438\u043c \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 (\u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u0437\u0430\u0431\u044b\u0442\u044c \u0432\u044b\u0447\u0435\u0441\u0442\u044c \u0438\u0437 \u0441\u0443\u043c\u043c\u0430\u0440\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0432\u0440\u0435\u043c\u044f \u00ab\u0445\u043e\u043b\u043e\u0441\u0442\u043e\u0433\u043e\u00bb \u043f\u0440\u043e\u0433\u043e\u043d\u0430 \u0446\u0438\u043a\u043b\u0430 \u043d\u0430 \u043c\u0438\u043b\u043b\u0438\u043e\u043d \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439). <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-274256","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274256","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=274256"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274256\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274256"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274256"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274256"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}