<?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: Performance Issue when using arcpy.mapping.ListDataFrames in Python Questions</title>
    <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143497#M11147</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you please send me a map package that includes your grid.&amp;nbsp; I'd like to do some testing on it.&amp;nbsp; There is no reason it should take 7 minutes.&amp;nbsp; Please send map package or zip to &lt;/SPAN&gt;&lt;A href="mailto:jbarrette@esri.com"&gt;jbarrette@esri.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 09 Nov 2011 13:11:01 GMT</pubDate>
    <dc:creator>JeffBarrette</dc:creator>
    <dc:date>2011-11-09T13:11:01Z</dc:date>
    <item>
      <title>Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143491#M11141</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I am using arcpy.mapping to create an atlas that will run via ArcGIS Server - the atlas uses two dataframes.&amp;nbsp; One of the dataframes holds the data driven pages grid and the other dataframe has a locked extent (so it zooms to wherever the atlas dataframe is zoomed to).&amp;nbsp; Everything works very well, except very slow performance for one step of my code.&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's some of the code I'm running- to find the mxd and then start updating some definition queries in my second dataframe (the one that has a locked extent):&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;mxd = arcpy.mapping.MapDocument(r"pathtomxd.mxd")
print datetime.datetime.now()

for df in arcpy.mapping.ListDataFrames(mxd, "Street View"):
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; print datetime.datetime.now()&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;When I compare the two datetime stamps- there is a 7 minute gap between the two.&amp;nbsp; Why is that?&amp;nbsp; The rest of the code runs in just about a minute (which is fine since it is exporting a whole map book).&amp;nbsp; But I just can't figure out why this one step takes 7 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Any ideas would be most appreciated!&amp;nbsp; &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Shawna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 07 Nov 2011 14:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143491#M11141</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2011-11-07T14:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143492#M11142</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Update:&amp;nbsp; I've found that it doesn't seem to matter what the second line of code is...even if I simply reference my data driven pages, it takes 6-7 minutes between the call to the mxd and the next call.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;mxd = arcpy.mapping.MapDocument(r"pathtomxd.mxd")
print datetime.datetime.now()

ddp = mxd.dataDrivenPages
print datetime.datetime.now()&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Why would that take so long?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:52:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143492#M11142</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2021-12-11T07:52:50Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143493#M11143</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;How large is the mxd?&amp;nbsp; Is it possible it is bloated? Have you tried saving it to a new file?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any broken SDE data sources?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 13:50:06 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143493#M11143</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-11-08T13:50:06Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143494#M11144</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Jeff,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;There are sixteen layers in my mxd and no broken connections.&amp;nbsp; I have tried saving it to a new file, but that doesn't make a difference in speed.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I do have a join to a SQL database for labels, but I've tested removing the join and don't see any performance gain.&amp;nbsp; It still takes 7 minutes.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Do you have any other ideas for me to test?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Shawna&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 14:35:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143494#M11144</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2011-11-08T14:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143495#M11145</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Can you try using the 'time' module to see if you have any improvement in performance?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;import arcpy, time
now = time.localtime(time.time())

mxd = arcpy.mapping.MapDocument(r"C:\TaxMapPages_DDP.mxd")
print time.asctime(now)

ddp = mxd.dataDrivenPages
print time.asctime(now)&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 07:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143495#M11145</guid>
      <dc:creator>JakeSkinner</dc:creator>
      <dc:date>2021-12-11T07:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143496#M11146</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Okay- the culprit is my atlas grid.&amp;nbsp; I tried creating a very small grid (just a few pages) and that runs almost instantly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;So, I guess I need to have a smaller grid.&amp;nbsp; That's unfortunate because I really need a comprehensive, County-wide atlas.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Jake- thanks for your post, using a different time module wasn't the issue in this case.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 08 Nov 2011 15:30:30 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143496#M11146</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2011-11-08T15:30:30Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143497#M11147</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Could you please send me a map package that includes your grid.&amp;nbsp; I'd like to do some testing on it.&amp;nbsp; There is no reason it should take 7 minutes.&amp;nbsp; Please send map package or zip to &lt;/SPAN&gt;&lt;A href="mailto:jbarrette@esri.com"&gt;jbarrette@esri.com&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jeff&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 09 Nov 2011 13:11:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143497#M11147</guid>
      <dc:creator>JeffBarrette</dc:creator>
      <dc:date>2011-11-09T13:11:01Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143498#M11148</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I figured out a work-around for the performance issue.&amp;nbsp; I don't load my entire atlas grid at once.&amp;nbsp; Instead, I have a definition query on the grid to limit the number of pages.&amp;nbsp; Then (since this script is going to take user input) I have my users enter in their area of interest.&amp;nbsp; I take that input and updated my definition query.&amp;nbsp; Finally, I have to refresh the data driven pages object to have the atlas update to the new area of interest.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Adding these additional steps made it so an atlas book that had taken 7 minutes to run took just 30 seconds.&amp;nbsp; So much better!!!&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 16 Nov 2011 17:11:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143498#M11148</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2011-11-16T17:11:27Z</dc:date>
    </item>
    <item>
      <title>Re: Performance Issue when using arcpy.mapping.ListDataFrames</title>
      <link>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143499#M11149</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Correction - you do not need to use definition queries to limit the number of atlas pages.&amp;nbsp; After working with Jeff (thanks, Jeff) - we determined that I had a corrupt atlas grid.&amp;nbsp; Once my grid was fixed, my performance issue was resolved with no need for extra steps in code.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Nov 2011 16:31:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/python-questions/performance-issue-when-using-arcpy-mapping/m-p/143499#M11149</guid>
      <dc:creator>ShawnaErnst</dc:creator>
      <dc:date>2011-11-23T16:31:04Z</dc:date>
    </item>
  </channel>
</rss>

