<?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: Why is this so so so slow?? in ArcObjects SDK Questions</title>
    <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689502#M18525</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also I should mention that "pTable" inside of that personal geodatabase has about 205,000 records.&amp;nbsp; If I produce the table pTable through VBA code in ArcMap, I can run through the above loop and multiple other loops in my function in less than 4 minutes.&amp;nbsp; What gives??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 21 Dec 2010 18:33:01 GMT</pubDate>
    <dc:creator>JoshV</dc:creator>
    <dc:date>2010-12-21T18:33:01Z</dc:date>
    <item>
      <title>Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689501#M18524</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;My below code is taking 15 minutes or more to run and I need to find a more efficient way.&amp;nbsp; Any ideas please??&amp;nbsp; Thanks for any help&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;ICursor pCursor;
IRow pRow2;
ICursor pTableCursor;
pTableCursor = pTable.Search(null, true);&amp;nbsp; //pTable is a table inside of a local personal geodatabase

pRow2 = pTableCursor.NextRow();
IRowBuffer pRowBuff;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
pRowBuff = pNewTable.CreateRowBuffer();&amp;nbsp;&amp;nbsp; //pNewTable is a table I just created inside a local File Geodatabase
pCursor = pNewTable.Insert(true);

do
&amp;nbsp; {
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //populate the row with values
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCWell_ID, pRow2.get_Value((Int32)l_Well_ID));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCSidetrack_Number, pRow2.get_Value((Int32)l_Sidetrack_Number));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCAlternate_ID, pRow2.get_Value((Int32)l_Alternate_ID));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCMeasured_Depth, pRow2.get_Value((Int32)l_Measured_Depth));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCInclination, pRow2.get_Value((Int32)l_Inclination));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCAzimuth, pRow2.get_Value((Int32)l_Azimuth));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCE_W, pRow2.get_Value((Int32)l_E_W));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCN_S, pRow2.get_Value((Int32)l_N_S));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCTVD, pRow2.get_Value((Int32)l_TVD));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCState_Plane_Easting, pRow2.get_Value((Int32)l_State_Plane_Easting));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCState_Plane_Northing, pRow2.get_Value((Int32)l_State_Plane_Northing));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCSub_Sea_TVD, pRow2.get_Value((Int32)l_Sub_Sea_TVD));
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCursor.InsertRow(pRowBuff);
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRow2 = pTableCursor.NextRow();

 } while (pRow2 != null);&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 17:08:05 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689501#M18524</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2010-12-21T17:08:05Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689502#M18525</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Also I should mention that "pTable" inside of that personal geodatabase has about 205,000 records.&amp;nbsp; If I produce the table pTable through VBA code in ArcMap, I can run through the above loop and multiple other loops in my function in less than 4 minutes.&amp;nbsp; What gives??&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 21 Dec 2010 18:33:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689502#M18525</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2010-12-21T18:33:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689503#M18526</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Josh,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;If you want to kick it up a notch, try load-only mode. This is something used in File GDB and SDE (although the way they actually work differs slightly between the two). For File GDB, basically it suspends all indexes - when you're finished, you knock it out of load-only mode, rebuilding the indexes. It should make a significant difference.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
IFeatureClassLoad featureClassLoad = (IFeatureClassLoad)pNewTable;
featureClassLoad.LoadOnlyMode = true;

// Get cursor, do inserts, etc., then...

featureClassLoad.LoadOnlyMode = false;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;James&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:01:01 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689503#M18526</guid>
      <dc:creator>JamesMacKay</dc:creator>
      <dc:date>2021-12-12T05:01:01Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689504#M18527</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi Josh,&lt;BR /&gt;&lt;BR /&gt;If you want to kick it up a notch, try load-only mode. This is something used in File GDB and SDE (although the way they actually work differs slightly between the two). For File GDB, basically it suspends all indexes - when you're finished, you knock it out of load-only mode, rebuilding the indexes. It should make a significant difference.&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
IFeatureClassLoad featureClassLoad = (IFeatureClassLoad)pNewTable;
featureClassLoad.LoadOnlyMode = true;

// Get cursor, do inserts, etc., then...

featureClassLoad.LoadOnlyMode = false;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;Cheers,&lt;BR /&gt;James&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Hi James-&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I tried your LoadOnlyMode method and set it in the correct spots as you suggested but it made no difference.&amp;nbsp; Is there anyway I should be adding the data differently in my Do While loop?&amp;nbsp; Should I be using IRowBuffer inside the Loop?&amp;nbsp; Everything seems to be pointing to this loop as to why it's running so slow..&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Please let me know any suggestions anyone.&amp;nbsp; Many Thanks -Josh&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:01:04 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689504#M18527</guid>
      <dc:creator>JoshV</dc:creator>
      <dc:date>2021-12-12T05:01:04Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689505#M18528</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Hi James-&lt;BR /&gt;&lt;BR /&gt;I tried your LoadOnlyMode method and set it in the correct spots as you suggested but it made no difference.&amp;nbsp; Is there anyway I should be adding the data differently in my Do While loop?&amp;nbsp; Should I be using IRowBuffer inside the Loop?&amp;nbsp; Everything seems to be pointing to this loop as to why it's running so slow..&lt;BR /&gt;&lt;BR /&gt;Please let me know any suggestions anyone.&amp;nbsp; Many Thanks -Josh&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; while (pRow2 != null);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp; {&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //populate the row with values&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCWell_ID, pRow2.get_Value((Int32)l_Well_ID));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCSidetrack_Number, pRow2.get_Value((Int32)l_Sidetrack_Number));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCAlternate_ID, pRow2.get_Value((Int32)l_Alternate_ID));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCMeasured_Depth, pRow2.get_Value((Int32)l_Measured_Depth));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCInclination, pRow2.get_Value((Int32)l_Inclination));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCAzimuth, pRow2.get_Value((Int32)l_Azimuth));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCE_W, pRow2.get_Value((Int32)l_E_W));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCN_S, pRow2.get_Value((Int32)l_N_S));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCTVD, pRow2.get_Value((Int32)l_TVD));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCState_Plane_Easting, pRow2.get_Value((Int32)l_State_Plane_Easting));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCState_Plane_Northing, pRow2.get_Value((Int32)l_State_Plane_Northing));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRowBuff.set_Value((Int32)l_FCSub_Sea_TVD, pRow2.get_Value((Int32)l_Sub_Sea_TVD));&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pCursor.InsertRow(pRowBuff);&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; pRow2 = pTableCursor.NextRow();&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt; }&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;try something like that...&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 28 Dec 2010 03:29:31 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689505#M18528</guid>
      <dc:creator>Venkata_RaoTammineni</dc:creator>
      <dc:date>2010-12-28T03:29:31Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689506#M18529</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;You seem to be doing the loop ok.&amp;nbsp; I wonder if so many cast operations is impacting the performance.&amp;nbsp; You may want to keep a set of int32 variables to avoid doing that in the loop.&amp;nbsp; I doubt that will make a huge difference though.&amp;nbsp; I suggest you comment different parts of the loop to see if the problem is looping through the source table, setting the values of the rowbuffer or inserting the row buffer.&amp;nbsp; What your code doesn't show is if the operation is embedded in a edit operation or an edit session or if your target table has a relationship class.&amp;nbsp; These are all things that impact performance.&amp;nbsp; You may also want to look at the ITableWrite2 interface that could speed things up.&amp;nbsp; You might also want to test against a file geodatabase instead of a personal geodatabase.&amp;nbsp; You may also want to compact the geodatabase after doing so many loads.&amp;nbsp; In fact you may benefit from compacting after every few tens of thousands of records too.&amp;nbsp; I also suggest getting a smaller dataset to try more variations without waiting 15 minutes for each test.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 29 Dec 2010 13:27:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689506#M18529</guid>
      <dc:creator>AlexanderGray</dc:creator>
      <dc:date>2010-12-29T13:27:09Z</dc:date>
    </item>
    <item>
      <title>Re: Why is this so so so slow??</title>
      <link>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689507#M18530</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Did you resolve this? If so how? I'm inserting 24 new rows in basically the same manner and it is slow as well.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 23 Jul 2011 14:26:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcobjects-sdk-questions/why-is-this-so-so-so-slow/m-p/689507#M18530</guid>
      <dc:creator>GregRieck</dc:creator>
      <dc:date>2011-07-23T14:26:54Z</dc:date>
    </item>
  </channel>
</rss>

