<?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 CreateLayer is extremely slow for lyr files in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createlayer-is-extremely-slow-for-lyr-files/m-p/876265#M5428</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed that &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic16726.html"&gt;LayerFactory.CreateLayer&lt;/A&gt;&lt;/SPAN&gt; takes huge amount of time to add content of lyr file to a map. On my computer it takes more than 5 minutes to add simple layer (lyr file is attached – &lt;STRONG&gt;TestLayer.lyr&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created simple test add-in to illustrate the problem (VS solution is attached – &lt;STRONG&gt;TestSlowCreateLayer.zip&lt;/STRONG&gt;). Add-in contains the button (named&amp;nbsp;&lt;EM&gt;Test slow CreateLayer&lt;/EM&gt;) which calls&lt;/P&gt;&lt;PRE class="line-numbers language-csharp"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; LayerFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerFilePath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Active&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;layerFilePath&lt;/SPAN&gt; is the path of attached lyr file (TestLayer.lyr). After method is executed the message box with execution time will be shown.&lt;/P&gt;&lt;P&gt;I can reproduce this behavior for every lyr file I take. Layer data is very simple as you can see.&lt;/P&gt;&lt;P&gt;Also I noticed high CPU usage for ArcGIS Pro while layer is being created: 70-80%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;CPU Intel Core i5-7200U&lt;/P&gt;&lt;P&gt;8 GB RAM&lt;/P&gt;&lt;P&gt;ArcGIS Pro&amp;nbsp;2.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My add-in should work in ArcgIS Pro 2.1 so I need to get it work good on this version. I suppose 5 minutes for provided lyr file is more than it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 25 Sep 2018 11:24:09 GMT</pubDate>
    <dc:creator>MaxMax2</dc:creator>
    <dc:date>2018-09-25T11:24:09Z</dc:date>
    <item>
      <title>CreateLayer is extremely slow for lyr files</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createlayer-is-extremely-slow-for-lyr-files/m-p/876265#M5428</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I noticed that &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;&lt;A href="https://pro.arcgis.com/en/pro-app/sdk/api-reference/index.html#topic16726.html"&gt;LayerFactory.CreateLayer&lt;/A&gt;&lt;/SPAN&gt; takes huge amount of time to add content of lyr file to a map. On my computer it takes more than 5 minutes to add simple layer (lyr file is attached – &lt;STRONG&gt;TestLayer.lyr&lt;/STRONG&gt;).&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I created simple test add-in to illustrate the problem (VS solution is attached – &lt;STRONG&gt;TestSlowCreateLayer.zip&lt;/STRONG&gt;). Add-in contains the button (named&amp;nbsp;&lt;EM&gt;Test slow CreateLayer&lt;/EM&gt;) which calls&lt;/P&gt;&lt;PRE class="line-numbers language-csharp"&gt;&lt;CODE&gt;&lt;SPAN class="keyword token"&gt;await&lt;/SPAN&gt; QueuedTask&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Run&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt; &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt;&lt;SPAN class="operator token"&gt;&amp;gt;&lt;/SPAN&gt; LayerFactory&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Instance&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;CreateLayer&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="keyword token"&gt;new&lt;/SPAN&gt; &lt;SPAN class="token class-name"&gt;Uri&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;layerFilePath&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;,&lt;/SPAN&gt; MapView&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Active&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Map&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;P&gt;where &lt;SPAN style="font-family: 'courier new', courier, monospace;"&gt;layerFilePath&lt;/SPAN&gt; is the path of attached lyr file (TestLayer.lyr). After method is executed the message box with execution time will be shown.&lt;/P&gt;&lt;P&gt;I can reproduce this behavior for every lyr file I take. Layer data is very simple as you can see.&lt;/P&gt;&lt;P&gt;Also I noticed high CPU usage for ArcGIS Pro while layer is being created: 70-80%.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Environment:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;CPU Intel Core i5-7200U&lt;/P&gt;&lt;P&gt;8 GB RAM&lt;/P&gt;&lt;P&gt;ArcGIS Pro&amp;nbsp;2.1&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;My add-in should work in ArcgIS Pro 2.1 so I need to get it work good on this version. I suppose 5 minutes for provided lyr file is more than it should be.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 25 Sep 2018 11:24:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createlayer-is-extremely-slow-for-lyr-files/m-p/876265#M5428</guid>
      <dc:creator>MaxMax2</dc:creator>
      <dc:date>2018-09-25T11:24:09Z</dc:date>
    </item>
    <item>
      <title>Re: CreateLayer is extremely slow for lyr files</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/createlayer-is-extremely-slow-for-lyr-files/m-p/876266#M5429</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Max&lt;/P&gt;&lt;P&gt;On my machine I was able to add the layer file using your sample in 28 seconds. So not sure what is happening.&amp;nbsp; Can you try contacting technical support to see if they can help figure out what is causing this delay on your machine.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;Uma&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 17 Oct 2018 18:12:39 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/createlayer-is-extremely-slow-for-lyr-files/m-p/876266#M5429</guid>
      <dc:creator>UmaHarano</dc:creator>
      <dc:date>2018-10-17T18:12:39Z</dc:date>
    </item>
  </channel>
</rss>

