{"id":1437,"date":"2019-10-21T14:57:05","date_gmt":"2019-10-21T12:57:05","guid":{"rendered":"http:\/\/tpodolak.com\/blog\/?p=1437"},"modified":"2019-10-21T14:57:05","modified_gmt":"2019-10-21T12:57:05","slug":"performance-improvements-nsubstitute-analyzers-1-0-11","status":"publish","type":"post","link":"https:\/\/tpodolak.com\/blog\/2019\/10\/21\/performance-improvements-nsubstitute-analyzers-1-0-11\/","title":{"rendered":"Performance improvements in NSubstitute.Analyzers 1.0.11"},"content":{"rendered":"<h3>1. Introduction<\/h3>\n<p>I am glad to announce that the latest release of <a href=\"https:\/\/www.nuget.org\/packages\/NSubstitute.Analyzers.CSharp\/1.0.11\">NSubstitute.Analyzers<\/a> (apart from some bugfixes) brings a lot of performance and memory usage improvements for most of the analyzers. The benchmark results shown below should give you enough information about the speed and memory consumption of the newest version of the library. If you are interested in actual changes behind these results please take a look at this <a href=\"https:\/\/github.com\/nsubstitute\/NSubstitute.Analyzers\/pull\/111\">pull request<\/a>.<br \/>\n<\/br><\/p>\n<h3>2. Benchmark comparision of NSubstitute.Analyzers.CSharp <\/h3>\n<table class=\"table table-bordered table-hover table-condensed\">\n<thead>\n<tr>\n<th title=\"Field #1\">Analyzer<\/th>\n<th title=\"Field #2\">Mean (us)<\/th>\n<th title=\"Field #3\">Error (us)<\/th>\n<th title=\"Field #4\">StdDev (us)<\/th>\n<th title=\"Field #5\">Gen 0<\/th>\n<th title=\"Field #6\">Gen 1<\/th>\n<th title=\"Field #7\">Allocated (KB)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CallInfoAnalyzer<\/td>\n<td>1,897.0<\/td>\n<td>5.646<\/td>\n<td>5.2814<\/td>\n<td align=\"right\">136.7188<\/td>\n<td>11.7188<\/td>\n<td>424.54<\/td>\n<\/tr>\n<tr>\n<td>ConflictingArgumentAssignmentsAnalyzer<\/td>\n<td>554.2<\/td>\n<td>1.018<\/td>\n<td>0.9524<\/td>\n<td align=\"right\">33.2031<\/td>\n<td>1.9531<\/td>\n<td>103.47<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberAnalyzer<\/td>\n<td>2,466.9<\/td>\n<td>9.317<\/td>\n<td>8.2596<\/td>\n<td align=\"right\">179.6875<\/td>\n<td>15.6250<\/td>\n<td>560.33<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberReceivedAnalyzer<\/td>\n<td>644.4<\/td>\n<td>2.280<\/td>\n<td>1.9039<\/td>\n<td align=\"right\">31.2500<\/td>\n<td>6.8359<\/td>\n<td>96.27<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberWhenAnalyzer<\/td>\n<td>995.9<\/td>\n<td>2.320<\/td>\n<td>1.9370<\/td>\n<td align=\"right\">37.1094<\/td>\n<td>7.8125<\/td>\n<td>116.74<\/td>\n<\/tr>\n<tr>\n<td>ReEntrantSetupAnalyzer<\/td>\n<td>57,979.0<\/td>\n<td>196.824<\/td>\n<td>174.4794<\/td>\n<td align=\"right\">2333.3333<\/td>\n<td>&#8211;<\/td>\n<td>7175.61<\/td>\n<\/tr>\n<tr>\n<td>SubstituteAnalyzer<\/td>\n<td>1,960.4<\/td>\n<td>8.197<\/td>\n<td>7.2666<\/td>\n<td align=\"right\">89.8438<\/td>\n<td>19.5313<\/td>\n<td>343.67<\/td>\n<\/tr>\n<tr>\n<td>UnusedReceivedAnalyzer<\/td>\n<td>524.0<\/td>\n<td>1.671<\/td>\n<td>1.5630<\/td>\n<td align=\"right\">29.2969<\/td>\n<td>1.9531<\/td>\n<td>92.45<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table class=\"table table-bordered table-hover table-condensed\">\n<caption style=\"caption-side:bottom; text-align: center;\">Benchmark results of NSubstitute.Analyzers.CSharp 1.0.11<br \/>\n    <\/caption>\n<thead>\n<tr>\n<th title=\"Field #1\">Analyzer<\/th>\n<th title=\"Field #2\">Mean (us)<\/th>\n<th title=\"Field #3\">Error (us)<\/th>\n<th title=\"Field #4\">StdDev (us)<\/th>\n<th title=\"Field #5\">Gen 0<\/th>\n<th title=\"Field #6\">Gen 1<\/th>\n<th title=\"Field #7\">Allocated (KB)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CallInfoAnalyzer<\/td>\n<td>1,828.8<\/td>\n<td>5.599<\/td>\n<td>4.963<\/td>\n<td align=\"right\">123.0469<\/td>\n<td align=\"right\">11.7188<\/td>\n<td>379.78<\/td>\n<\/tr>\n<tr>\n<td>ConflictingArgumentAssignmentsAnalyzer<\/td>\n<td>510.3<\/td>\n<td>1.973<\/td>\n<td>1.846<\/td>\n<td align=\"right\">33.2031<\/td>\n<td align=\"right\">1.9531<\/td>\n<td>102.76<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberAnalyzer<\/td>\n<td>766.0<\/td>\n<td>2.798<\/td>\n<td>2.336<\/td>\n<td align=\"right\">39.0625<\/td>\n<td align=\"right\">8.7891<\/td>\n<td>122.27<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberReceivedAnalyzer<\/td>\n<td>600.6<\/td>\n<td>3.411<\/td>\n<td>3.191<\/td>\n<td align=\"right\">27.3438<\/td>\n<td align=\"right\">5.8594<\/td>\n<td>85.82<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberWhenAnalyzer<\/td>\n<td>866.0<\/td>\n<td>3.144<\/td>\n<td>2.941<\/td>\n<td align=\"right\">34.1797<\/td>\n<td align=\"right\">9.7656<\/td>\n<td>107.87<\/td>\n<\/tr>\n<tr>\n<td>ReEntrantSetupAnalyzer<\/td>\n<td>7,442.0<\/td>\n<td>34.067<\/td>\n<td>31.866<\/td>\n<td align=\"right\">281.2500<\/td>\n<td align=\"right\">15.6250<\/td>\n<td>870.18<\/td>\n<\/tr>\n<tr>\n<td>SubstituteAnalyzer<\/td>\n<td>1,870.2<\/td>\n<td>29.787<\/td>\n<td>27.863<\/td>\n<td align=\"right\">87.8906<\/td>\n<td align=\"right\">23.4375<\/td>\n<td>346.09<\/td>\n<\/tr>\n<tr>\n<td>UnusedReceivedAnalyzer<\/td>\n<td>482.1<\/td>\n<td>1.705<\/td>\n<td>1.511<\/td>\n<td align=\"right\">25.8789<\/td>\n<td align=\"right\">1.9531<\/td>\n<td>80.96<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><\/br><\/p>\n<h3>3. Benchmark comparision of NSubstitute.Analyzers.VisualBasic <\/h3>\n<table class=\"table table-bordered table-hover table-condensed\">\n<thead>\n<tr>\n<th title=\"Field #1\">Method<\/th>\n<th title=\"Field #2\">Mean (ms)<\/th>\n<th title=\"Field #3\">Error (ms)<\/th>\n<th title=\"Field #4\">StdDev (ms)<\/th>\n<th title=\"Field #5\">Gen 0<\/th>\n<th title=\"Field #6\">Gen 1<\/th>\n<th title=\"Field #7\">Allocated (KB)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CallInfoAnalyzer<\/td>\n<td>3.459<\/td>\n<td>0.0137<\/td>\n<td>0.0121<\/td>\n<td align=\"right\">156.2500<\/td>\n<td>11.7188<\/td>\n<td>484.15<\/td>\n<\/tr>\n<tr>\n<td>ConflictingArgumentAssignmentsAnalyzer<\/td>\n<td>1.279<\/td>\n<td>0.0103<\/td>\n<td>0.0086<\/td>\n<td align=\"right\">21.4844<\/td>\n<td>1.9531<\/td>\n<td>69.15<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberAnalyzer<\/td>\n<td>1.975<\/td>\n<td>0.0108<\/td>\n<td>0.0090<\/td>\n<td align=\"right\">35.1563<\/td>\n<td>7.8125<\/td>\n<td>108<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberReceivedAnalyzer<\/td>\n<td>1.287<\/td>\n<td>0.0070<\/td>\n<td>0.0065<\/td>\n<td align=\"right\">13.6719<\/td>\n<td>1.9531<\/td>\n<td>47.46<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberWhenAnalyzer<\/td>\n<td>1.589<\/td>\n<td>0.0103<\/td>\n<td>0.0092<\/td>\n<td align=\"right\">25.3906<\/td>\n<td>5.8594<\/td>\n<td>82.72<\/td>\n<\/tr>\n<tr>\n<td>ReEntrantSetupAnalyzer<\/td>\n<td>54.131<\/td>\n<td>0.2320<\/td>\n<td>0.1937<\/td>\n<td align=\"right\">3600.0000<\/td>\n<td>&#8211;<\/td>\n<td>11139.45<\/td>\n<\/tr>\n<tr>\n<td>SubstituteAnalyzer<\/td>\n<td>3.615<\/td>\n<td>0.0168<\/td>\n<td>0.0149<\/td>\n<td align=\"right\">105.4688<\/td>\n<td>23.4375<\/td>\n<td>393.13<\/td>\n<\/tr>\n<tr>\n<td>UnusedReceivedAnalyzer<\/td>\n<td>1.306<\/td>\n<td>0.0258<\/td>\n<td>0.0528<\/td>\n<td align=\"right\">13.6719<\/td>\n<td>1.9531<\/td>\n<td>43.3<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<table class=\"table table-bordered table-hover table-condensed\">\n<caption style=\"caption-side:bottom; text-align: center;\">Benchmark results of NSubstitute.Analyzers.VisualBasic<br \/>\n        1.0.11<br \/>\n    <\/caption>\n<thead>\n<tr>\n<th title=\"Field #1\">Analyzer<\/th>\n<th title=\"Field #2\">Mean (ms)<\/th>\n<th title=\"Field #3\">Error (ms)<\/th>\n<th title=\"Field #4\">StdDev (ms)<\/th>\n<th title=\"Field #5\">Gen 0<\/th>\n<th title=\"Field #6\">Gen 1<\/th>\n<th title=\"Field #7\">Allocated (KB)<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td>CallInfoAnalyzer<\/td>\n<td>3.737<\/td>\n<td>0.0878<\/td>\n<td>0.1110<\/td>\n<td align=\"right\">152.3438<\/td>\n<td>11.7188<\/td>\n<td>471.79<\/td>\n<\/tr>\n<tr>\n<td>ConflictingArgumentAssignmentsAnalyzer<\/td>\n<td>1.402<\/td>\n<td>0.0266<\/td>\n<td>0.0285<\/td>\n<td align=\"right\">21.4844<\/td>\n<td>1.9531<\/td>\n<td>68.36<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberAnalyzer<\/td>\n<td>1.543<\/td>\n<td>0.0264<\/td>\n<td>0.0247<\/td>\n<td align=\"right\">25.3906<\/td>\n<td>5.8594<\/td>\n<td>81<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberReceivedAnalyzer<\/td>\n<td>1.213<\/td>\n<td>0.0051<\/td>\n<td>0.0048<\/td>\n<td align=\"right\">13.6719<\/td>\n<td>1.9531<\/td>\n<td>45.43<\/td>\n<\/tr>\n<tr>\n<td>NonSubstitutableMemberWhenAnalyzer<\/td>\n<td>1.475<\/td>\n<td>0.0055<\/td>\n<td>0.0051<\/td>\n<td align=\"right\">27.3438<\/td>\n<td>7.8125<\/td>\n<td>85.25<\/td>\n<\/tr>\n<tr>\n<td>ReEntrantSetupAnalyzer<\/td>\n<td>7.044<\/td>\n<td>0.0236<\/td>\n<td>0.0209<\/td>\n<td align=\"right\">265.6250<\/td>\n<td>7.8125<\/td>\n<td>837.14<\/td>\n<\/tr>\n<tr>\n<td>SubstituteAnalyzer<\/td>\n<td>3.333<\/td>\n<td>0.0912<\/td>\n<td>0.1186<\/td>\n<td align=\"right\">101.5625<\/td>\n<td>23.4375<\/td>\n<td>377.16<\/td>\n<\/tr>\n<tr>\n<td>UnusedReceivedAnalyzer<\/td>\n<td>1.102<\/td>\n<td>0.0067<\/td>\n<td>0.0062<\/td>\n<td align=\"right\">11.7188<\/td>\n<td>&#8211;<\/td>\n<td>40.24<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n","protected":false},"excerpt":{"rendered":"<p>1. Introduction I am glad to announce that the latest release of NSubstitute.Analyzers (apart from some bugfixes) brings a lot of performance and memory usage improvements for most of the analyzers. The benchmark results shown below should give you enough information about the speed and memory consumption of the newest version of the library. If [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[326],"tags":[327,335,336],"class_list":["post-1437","post","type-post","status-publish","format-standard","hentry","category-nsubstitute","tag-nsubstitute","tag-nsubstitute-analyzers","tag-roslyn"],"_links":{"self":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1437","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/comments?post=1437"}],"version-history":[{"count":37,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1437\/revisions"}],"predecessor-version":[{"id":1474,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/posts\/1437\/revisions\/1474"}],"wp:attachment":[{"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/media?parent=1437"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/categories?post=1437"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tpodolak.com\/blog\/wp-json\/wp\/v2\/tags?post=1437"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}