<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic C# vs VB.NET. Perfomance in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306937#M7995</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your session, Mark. Very interesting! I wasn't there, at Palm Springs, and there is no video (maybe later?), but I've read the presentation - very cool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Sorry for my English.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 08 Apr 2010 19:29:42 GMT</pubDate>
    <dc:creator>DenisT</dc:creator>
    <dc:date>2010-04-08T19:29:42Z</dc:date>
    <item>
      <title>C# vs VB.NET. Perfomance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306934#M7992</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Why there is so big difference in C# / VB.NET perfomance?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;There was a &lt;/SPAN&gt;&lt;A href="http://events.esri.com/bpc/2010/dev_agenda/index.cfm?fa=Session_Detail_Form&amp;amp;SessionId=181&amp;amp;ScheduleId=309"&gt;session&lt;/A&gt;&lt;SPAN&gt; at devsummit 2010. There is a &lt;/SPAN&gt;&lt;A href="http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.pdf"&gt;presentation&lt;/A&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;A href="http://www.pierssen.com/arcgis/upload/misc/python_arcobjects.zip"&gt;sources&lt;/A&gt;&lt;SPAN&gt; of the benchmark. The benchmark measured ShapeCopy operation.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;VB.NET is 30 times (!!!) faster then C#. Not 5-10-30%, but 30 times!&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Should we prefer VB.NET to write applications using ArcObjects?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Is it possible to get the same perfomance using C#?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Apr 2010 08:21:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306934#M7992</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2010-04-04T08:21:26Z</dc:date>
    </item>
    <item>
      <title>The solution</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306935#M7993</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;As an ArcObjects developer, this means that if your application is not initialized as a single threaded application, the .NET framework will create a special single threaded apartment (STA) thread for all ArcObjects since they are marked as STA. This will cause a thread switch to this thread on each call from the application to ArcObjects. In turn, this forces the ArcObjects components to marshall each call, and eventually it may be about &lt;STRONG&gt;50 times slower&lt;/STRONG&gt; for a call to the COM component. Fortunately, this can be avoided by &lt;STRONG&gt;simply marking the main function as [STAThread].&lt;/STRONG&gt;&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;A href="http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/2c2d2655-a208-4902-bf4d-b37a1de120de.htm"&gt;http://resources.esri.com/help/9.3/ArcGISDesktop/dotnet/2c2d2655-a208-4902-bf4d-b37a1de120de.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;&lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Tested. Everything is fine now, the perfomance is just the same.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 05 Apr 2010 06:23:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306935#M7993</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2010-04-05T06:23:37Z</dc:date>
    </item>
    <item>
      <title>C# vs VB.NET. Perfomance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306936#M7994</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Excellent!&amp;nbsp; Thanks for finding that out.&amp;nbsp; It was my assumption all along that their performance &lt;/SPAN&gt;&lt;SPAN style="font-style:italic;"&gt;should&lt;/SPAN&gt;&lt;SPAN&gt; be the same, and I was shocked when the benchmark turned out otherwise.&amp;nbsp; I'm going to look into whether this is also the reason behind crappy C++/CLI performance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Update:&amp;nbsp; Never mind my last update.&amp;nbsp; I've brought VB in line with C# and F#, and C++/CLI (unmanaged) is in line with C++/ATL.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 16:27:28 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306936#M7994</guid>
      <dc:creator>MarkCederholm</dc:creator>
      <dc:date>2010-04-08T16:27:28Z</dc:date>
    </item>
    <item>
      <title>C# vs VB.NET. Perfomance</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306937#M7995</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for your session, Mark. Very interesting! I wasn't there, at Palm Springs, and there is no video (maybe later?), but I've read the presentation - very cool.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;P.S. Sorry for my English.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 08 Apr 2010 19:29:42 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/c-vs-vb-net-perfomance/m-p/306937#M7995</guid>
      <dc:creator>DenisT</dc:creator>
      <dc:date>2010-04-08T19:29:42Z</dc:date>
    </item>
  </channel>
</rss>

