<?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 Re: arcpy runs slow outside arcgis pro in ArcGIS Pro Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122673#M48647</link>
    <description>&lt;P&gt;Kind of a long shot, but is your data on a network drive? That's usually what slows down my scripts (though the lag time is worse inside Pro than outside). If your data is not on your local machine, it could be a latency issue where the computer is having to work harder to access the data and write the results.&lt;/P&gt;</description>
    <pubDate>Fri, 03 Dec 2021 22:09:11 GMT</pubDate>
    <dc:creator>AmyRoust</dc:creator>
    <dc:date>2021-12-03T22:09:11Z</dc:date>
    <item>
      <title>arcpy runs slow outside arcgis pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122518#M48635</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I wrote a python geoprocessing tool.&lt;/P&gt;&lt;P&gt;If I run it in Arcgis pro it takes about 11 minutes, but if I run it outside Arcgis pro it takes hours?&lt;/P&gt;&lt;P&gt;I don't know why!&lt;/P&gt;&lt;P&gt;The tool loops over records in a csv file (about 6700 rows)&lt;/P&gt;&lt;P&gt;For each row performs a spatial selection (arcpy.management.SelectLayerByLocation) creating a layer.&lt;/P&gt;&lt;P&gt;After that, it performs some selections and calculations with the selected features and write results in a file geodb table (see the attachment).&lt;/P&gt;&lt;P&gt;If I run the tool in Arcgis pro it takes about 1 seconds to process 10 record in the csv file.&lt;/P&gt;&lt;P&gt;When I run outside Arcgis pro, it starts with 1 sec for 10 recs, but after few loops it takes 1 second for 1 or 2 records.&lt;/P&gt;&lt;P&gt;Does anybody have any ideas or suggestions?&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 09:43:26 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122518#M48635</guid>
      <dc:creator>MarcoBelotti</dc:creator>
      <dc:date>2021-12-09T09:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy runs slow outside arcgis pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122521#M48636</link>
      <description>&lt;P&gt;You might check this out even if it refers to 10.3. in particular the use of layers over data on a drive.&amp;nbsp; &lt;A href="https://desktop.arcgis.com/en/arcmap/10.3/analyze/sharing-workflows/performance-tips-for-geoprocessing-services.htm" target="_blank"&gt;https://desktop.arcgis.com/en/arcmap/10.3/analyze/sharing-workflows/performance-tips-for-geoprocessing-services.htm&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 14:54:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122521#M48636</guid>
      <dc:creator>JohnSobetzer</dc:creator>
      <dc:date>2021-12-03T14:54:52Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy runs slow outside arcgis pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122641#M48643</link>
      <description>&lt;P&gt;Perhaps apply&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/latest/tool-reference/data-management/make-feature-layer.htm" target="_self"&gt;arcpy.MakeFeatureLayer()&lt;/A&gt; on your feature classes first and reference those feature layers (in memory) to make your spatial selections.&amp;nbsp; Just a guess...&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 19:57:00 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122641#M48643</guid>
      <dc:creator>JoeBorgione</dc:creator>
      <dc:date>2021-12-03T19:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy runs slow outside arcgis pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122673#M48647</link>
      <description>&lt;P&gt;Kind of a long shot, but is your data on a network drive? That's usually what slows down my scripts (though the lag time is worse inside Pro than outside). If your data is not on your local machine, it could be a latency issue where the computer is having to work harder to access the data and write the results.&lt;/P&gt;</description>
      <pubDate>Fri, 03 Dec 2021 22:09:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1122673#M48647</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2021-12-03T22:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: arcpy runs slow outside arcgis pro</title>
      <link>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1124232#M48860</link>
      <description>&lt;P&gt;Thanks to&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3278"&gt;@JohnSobetzer&lt;/a&gt;&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/3374"&gt;@JoeBorgione&lt;/a&gt;&amp;nbsp;and&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/82823"&gt;@AmyRoust&lt;/a&gt;&amp;nbsp;for the suggestions!&lt;/P&gt;&lt;P&gt;I changed my script: now I'm using GenerateNearTable and Intersect tools instead of&amp;nbsp;SelectLayerByLocation and cursors.&lt;/P&gt;&lt;P&gt;Now it takes about 5 seconds instead of 11 minutes!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 09 Dec 2021 09:51:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-questions/arcpy-runs-slow-outside-arcgis-pro/m-p/1124232#M48860</guid>
      <dc:creator>MarcoBelotti</dc:creator>
      <dc:date>2021-12-09T09:51:09Z</dc:date>
    </item>
  </channel>
</rss>

