<?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: Running ArcPy script with unsaved edits = massive processing speed boost in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432372#M34008</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently, no.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have previously added this to the script to test, and nothing changed speed wise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 02 Jul 2020 05:24:53 GMT</pubDate>
    <dc:creator>EC1</dc:creator>
    <dc:date>2020-07-02T05:24:53Z</dc:date>
    <item>
      <title>Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432370#M34006</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;I have written a script which snaps points to lines, it is a more complex version of the Snapper tool, except it snaps points to a specific end of a line depending on its orientation and connections to other lines.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;The script works fine as is. I use a W&lt;EM&gt;ith&lt;/EM&gt; statement to open the update cursor and then a for loop, to loop through the points, each point then searches for lines within a given distance to find an appropriate line to snap said point to. I am not using edit.start/edit.stop as I believe that the&amp;nbsp;&lt;EM&gt;With&amp;nbsp;&lt;/EM&gt;opening the updateCursor is handing this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Now, I am running the script while I have the data open and visible on ArcPro. When I run the script normally I do not have any unsaved edits from manual editing (so the save button under the edit ribbon is greyed out). When I run the script it takes about 10 seconds per point to process and snap a point to a nearby line (if there is one). Once this is finished the edits are saved automatically (the save button under the edit ribbon is still greyed out)&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;But&lt;/EM&gt;. If I edit a point manually, and I have unsaved edits open (the save button in edit ribbon is coloured) and run the script, it&amp;nbsp;processes at about 10 times faster than before, taking only one second per point to process. I have not noticed any issues with the data which has been processed this way. I can hit save after this processing and all changes are saved.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;This has lead me to believe that somehow my script is committing saves for each point it processes (when I have no unsaved edits) and making my script run much slower than it could.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My question is:&lt;/STRONG&gt; How can I impliment what is happening here in my script so I do not need to do this weird trick to get faster processing,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;EM&gt;EDIT: attached script&lt;/EM&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 02:32:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432370#M34006</guid>
      <dc:creator>EC1</dc:creator>
      <dc:date>2020-07-02T02:32:32Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432371#M34007</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Are you using the data access editor?&lt;/P&gt;&lt;P&gt;&lt;A class="link-titled" href="https://pro.arcgis.com/en/pro-app/arcpy/data-access/editor.htm" title="https://pro.arcgis.com/en/pro-app/arcpy/data-access/editor.htm"&gt;Editor—Data Access module | Documentation&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 03:35:47 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432371#M34007</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-02T03:35:47Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432372#M34008</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Currently, no.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;But I have previously added this to the script to test, and nothing changed speed wise.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 05:24:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432372#M34008</guid>
      <dc:creator>EC1</dc:creator>
      <dc:date>2020-07-02T05:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432373#M34009</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;EC, what about starting an edit session programmatically?&amp;nbsp;&lt;A href="https://pro.arcgis.com/en/pro-app/arcpy/data-access/editor.htm"&gt;Editor&lt;/A&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 10:08:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432373#M34009</guid>
      <dc:creator>MatthewDobson</dc:creator>
      <dc:date>2020-07-02T10:08:52Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432374#M34010</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;&lt;A href="https://community.esri.com/migrated-users/5081"&gt;Matthew Dobson&lt;/A&gt;‌ I suggested that already&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 12:04:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432374#M34010</guid>
      <dc:creator>DanPatterson</dc:creator>
      <dc:date>2020-07-02T12:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432375#M34011</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Apologies Dan, I misread and thought you had suggested the .da module.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 12:58:34 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432375#M34011</guid>
      <dc:creator>MatthewDobson</dc:creator>
      <dc:date>2020-07-02T12:58:34Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432376#M34012</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Without sharing any specifics, like back-end data store or code structure snippets, it is hard for people to share specific suggestions.&amp;nbsp; Given that ArcPy DA cursors were created to improve performance, and have been demonstrated to significantly improve performance in many situations, saying that using old/legacy cursors and new/DA cursors makes no difference leads me to believe the issue isn't really related to cursors themselves.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 02 Jul 2020 14:55:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432376#M34012</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-07-02T14:55:30Z</dc:date>
    </item>
    <item>
      <title>Re: Running ArcPy script with unsaved edits = massive processing speed boost</title>
      <link>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432377#M34013</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hello,&amp;nbsp;&lt;BR /&gt;I can share the whole script if that would help - I've just got to figure out how to.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;EDIT: See attached&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Jul 2020 05:09:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/running-arcpy-script-with-unsaved-edits-massive/m-p/432377#M34013</guid>
      <dc:creator>EC1</dc:creator>
      <dc:date>2020-07-03T05:09:05Z</dc:date>
    </item>
  </channel>
</rss>

