<?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 Performance penalty with using Beta 3 version of the API in File Geodatabase API Questions</title>
    <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214868#M384</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tested out the performance of the Beta3 API release and I noticed a huge difference in writing and deleting geometries in the database.&amp;nbsp; I wrote two simple test programs using the Editing sample to write 25k points to a table then delete them.&amp;nbsp; As my test numbers show, it takes almost 5x as long to Write and Delete the points in the beta3 version than it did in beta2.&amp;nbsp; Is there a reason there is such a huge difference between the two APIs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The times from my test programs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Beta2 version:

Testing with 25,000 points.
Finished inserting rows, time taken: 4.531s
Finished deleting all rows, time taken: 3.371s
Total time taken: 7.904s

Beta3 version:

Testing with 25,000 points.
Finished inserting rows, time taken: 19.388s
Finished deleting all rows, time taken: 18.013s
Total time taken: 37.404s
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The testing programs were based on the Editing sample.&amp;nbsp; They write to the a clean geodatabase/table.&amp;nbsp; Beta2 version uses the raw buffer (allocate + memcpy) while Beta3 version uses PointShapeBuffer (Setup + GetPoints) for geometry creation.&amp;nbsp; They both use table.Delete(row) to remove a row.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Wed, 23 Mar 2011 19:16:43 GMT</pubDate>
    <dc:creator>SasaI_</dc:creator>
    <dc:date>2011-03-23T19:16:43Z</dc:date>
    <item>
      <title>Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214868#M384</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I tested out the performance of the Beta3 API release and I noticed a huge difference in writing and deleting geometries in the database.&amp;nbsp; I wrote two simple test programs using the Editing sample to write 25k points to a table then delete them.&amp;nbsp; As my test numbers show, it takes almost 5x as long to Write and Delete the points in the beta3 version than it did in beta2.&amp;nbsp; Is there a reason there is such a huge difference between the two APIs?&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The times from my test programs:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;
Beta2 version:

Testing with 25,000 points.
Finished inserting rows, time taken: 4.531s
Finished deleting all rows, time taken: 3.371s
Total time taken: 7.904s

Beta3 version:

Testing with 25,000 points.
Finished inserting rows, time taken: 19.388s
Finished deleting all rows, time taken: 18.013s
Total time taken: 37.404s
&lt;/PRE&gt;&lt;DIV style="display:none;"&gt; &lt;/DIV&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The testing programs were based on the Editing sample.&amp;nbsp; They write to the a clean geodatabase/table.&amp;nbsp; Beta2 version uses the raw buffer (allocate + memcpy) while Beta3 version uses PointShapeBuffer (Setup + GetPoints) for geometry creation.&amp;nbsp; They both use table.Delete(row) to remove a row.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Wed, 23 Mar 2011 19:16:43 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214868#M384</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2011-03-23T19:16:43Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214869#M385</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Just to add to the above findings.&amp;nbsp; I tested writing lines this morning, and found similar issues.&amp;nbsp; The speed isn't largely affected by the number of points written, the slowdown is mainly in the number of features written (this is true for beta 2 and beta 3 releases, and makes perfect sense).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Beta 2 Timings:

Wrote 10000 polylines to the database (total of 25006 points) in 2,554.00ms
Wrote 10000 polylines to the database (total of 59854 points) in 2,462.00ms

Beta 3 Timings:

Wrote 10000 polylines to the database (total of 25005 points) in 9,871.00ms
Wrote 10000 polylines to the database (total of 60040 points) in 10,348.00ms
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:31:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214869#M385</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2021-12-11T10:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214870#M386</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Which Visual Studio? 32-bit or 64-bit? Are you using the Release or Debug libraries?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Are the jobs run on the same machine with identical load?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Why do the Beta-2 and Beta-3 passes have different numbers of vertices?&amp;nbsp; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;How large are the directories before you start delete operations?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;What happens if you use the Beta-2 shape creation protocol with the Beta-3 API DLL (one variable test)?&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;- V&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 15:47:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214870#M386</guid>
      <dc:creator>VinceAngelo</dc:creator>
      <dc:date>2011-03-24T15:47:11Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214871#M387</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Which Visual Studio? 32-bit or 64-bit? Are you using the Release or Debug libraries?&lt;BR /&gt; &lt;BR /&gt;Are the jobs run on the same machine with identical load?&lt;BR /&gt; &lt;BR /&gt;Why do the Beta-2 and Beta-3 passes have different numbers of vertices?&amp;nbsp; &lt;BR /&gt; &lt;BR /&gt;How large are the directories before you start delete operations?&lt;BR /&gt; &lt;BR /&gt;What happens if you use the Beta-2 shape creation protocol with the Beta-3 API DLL (one variable test)?&lt;BR /&gt; &lt;BR /&gt;- V&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Visual Studio 2008 v9.0.30729.4462 QFE (32bit) running on Windows 7 64bit.&amp;nbsp; Projects are compiled as 32-bit projects against the Debug libraries.&amp;nbsp; Jobs are run on the same machine with an identical load.&amp;nbsp; The reason for the different number of vertices in the second run is because the test creates 10k polylines, each with 1 part and a random number of vertices per part (2-3 in the first run for both, 2-10 in the second run).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;For sake of comparing apples to apples, I re-wrote the test to write 10k polylines, each with 1 part.&amp;nbsp; The first test writes 2 vertices per part for a total of 20k points, the second writes 6 vertices per part for a total of 60k points.&amp;nbsp; I've posted both the results and the code I use to test.&amp;nbsp; I'd be more than happy to hear about any improvements to the code that I can as I'm definitely not a highly experienced C++ programmer (I come from a C# background).&amp;nbsp; As with the previous tests, both of the tests write to the same copy of the database (I created an original and make a copy of the clean original for each test run).&amp;nbsp; I've tried running the test a number of times, each time receiving results that vary by less than 0.5s in case of beta 3, and around 0.25s for beta 2.&amp;nbsp; Apparently I didn't install X64 Compilers and Tools when I installed VS2008 so I can test with 64bit until I install the component, but when I do I will re-run the test.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here are the results:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Beta 2:

Wrote 10000 to the database (total of 20000 points) in 1.955s
Finished deleting all rows, time taken: 1.385s

Wrote 10000 to the database (total of 60000 points) in 2.057s
Finished deleting all rows, time taken: 1.422s


Beta 3:

Wrote 10000 to the database (total of 20000 points) in 8.042s
Finished deleting all rows, time taken: 7.591s

Wrote 10000 to the database (total of 60000 points) in 8.094s
Finished deleting all rows, time taken: 7.729s
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Here's the code snippet I use to create the lines in beta 2:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
int numPoints = 6;
int numParts = 1;
int partIdx = 0;
unsigned long length = 48 + numPoints * 16;
int totPoints = 0;
int totLines = 10000;
int shapetype = 3;

wcout &amp;lt;&amp;lt; "Testing with " &amp;lt;&amp;lt; totLines &amp;lt;&amp;lt; " lines." &amp;lt;&amp;lt; endl;

Row r;
ShapeBuffer geom;
clock_t start = clock();
for (int i=0; i&amp;lt;totLines; i++) {
 table.CreateRowObject(r);

 r.SetString(L"TextField", L"");
 r.SetDouble(L"DoubleField1", 0.0);
 r.SetDouble(L"DoubleField2", 0.0);
 r.SetNull(L"DateField");
 r.SetInteger(L"IntegerField1", 0);
 r.SetInteger(L"IntegerField2", 0);

 geom.Allocate(length);
 memcpy(geom.shapeBuffer, &amp;amp;shapetype, sizeof(shapetype)); // Shapetype
 memcpy(geom.shapeBuffer + 36, &amp;amp;numParts, sizeof(numParts)); // Number of parts
 memcpy(geom.shapeBuffer + 40, &amp;amp;numPoints, sizeof(numPoints)); // Number of points
 memcpy(geom.shapeBuffer + 44, &amp;amp;partIdx, sizeof(partIdx)); // Fist (and only) part index

 double minx = 180, miny = 90, maxx = -180, maxy = -90;

 rand();
 for (int j=0; j&amp;lt;numPoints; j++) {
&amp;nbsp; totPoints++;

&amp;nbsp; double x = -180.0 + rand() * (360.0) / RAND_MAX;
&amp;nbsp; double y = -90.0 + rand() * (180.0) / RAND_MAX;

&amp;nbsp; if (x &amp;lt; minx) minx = x;
&amp;nbsp; if (x &amp;gt; maxx) maxx = x;
&amp;nbsp; if (y &amp;lt; miny) miny = y;
&amp;nbsp; if (y &amp;gt; maxy) maxy = y;

&amp;nbsp; memcpy(geom.shapeBuffer + 48 + j*2*sizeof(double), &amp;amp;x, sizeof(double)); // X
&amp;nbsp; memcpy(geom.shapeBuffer + 48 + j*2*sizeof(double)+sizeof(double), &amp;amp;y, sizeof(double)); // Y
 }

 // Copy the extent
 memcpy(geom.shapeBuffer + 4, &amp;amp;minx, sizeof(double));
 memcpy(geom.shapeBuffer + 12, &amp;amp;miny, sizeof(double));
 memcpy(geom.shapeBuffer + 20, &amp;amp;maxx, sizeof(double));
 memcpy(geom.shapeBuffer + 28, &amp;amp;maxy, sizeof(double));

 geom.inUseLength = length;
 r.SetGeometry(geom);

 // Store the row.
 if ((hr = table.Insert(r)) != S_OK)
 {
&amp;nbsp; wcout &amp;lt;&amp;lt; "An error occurred while inserting a row." &amp;lt;&amp;lt; endl;
&amp;nbsp; wcout &amp;lt;&amp;lt; "Error code: " &amp;lt;&amp;lt; hr &amp;lt;&amp;lt; endl;
&amp;nbsp; return -1;
 }
}


time_t delstart = clock();
wcout &amp;lt;&amp;lt; "Wrote " &amp;lt;&amp;lt; totLines &amp;lt;&amp;lt; " to the database (total of " &amp;lt;&amp;lt; totPoints &amp;lt;&amp;lt; " points) in " &amp;lt;&amp;lt; (delstart - start)/1000.0 &amp;lt;&amp;lt; "s" &amp;lt;&amp;lt; endl;
&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;And the similar code for beta 3:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
int numPoints = 6;
int numParts = 1;
int partIdx = 0;
int totPoints = 0;
int totLines = 10000;
int shapetype = 3;

wcout &amp;lt;&amp;lt; "Testing with " &amp;lt;&amp;lt; totLines &amp;lt;&amp;lt; " lines." &amp;lt;&amp;lt; endl;

Row r;
MultiPartShapeBuffer geom;

clock_t start = clock();
for (int i=0; i&amp;lt;totLines; i++) {
 table.CreateRowObject(r);

 r.SetString(L"TextField", L"");
 r.SetDouble(L"DoubleField1", 0.0);
 r.SetDouble(L"DoubleField2", 0.0);
 r.SetNull(L"DateField");
 r.SetInteger(L"IntegerField1", 0);
 r.SetInteger(L"IntegerField2", 0);

 hr = geom.Setup(shapetype, numParts, numPoints, 0);

 Point* points;
 hr = geom.GetPoints(points);

 for (int j=0; j&amp;lt;numPoints; j++) {
&amp;nbsp; totPoints++;

&amp;nbsp; points&lt;J&gt;.x = -180.0 + rand() * (360.0) / RAND_MAX;
&amp;nbsp; points&lt;J&gt;.y = -90.0 + rand() * (180.0) / RAND_MAX;
 }

 geom.CalculateExtent();

 r.SetGeometry(geom);

 // Store the row.
 if ((hr = table.Insert(r)) != S_OK)
 {
&amp;nbsp; wcout &amp;lt;&amp;lt; "An error occurred while inserting a row." &amp;lt;&amp;lt; endl;
&amp;nbsp; ErrorInfo::GetErrorDescription(hr, errorText);
&amp;nbsp; wcout &amp;lt;&amp;lt; errorText &amp;lt;&amp;lt; "(" &amp;lt;&amp;lt; hr &amp;lt;&amp;lt; ")." &amp;lt;&amp;lt; endl;
&amp;nbsp; return -1;
 }
}

time_t delstart = clock();
wcout &amp;lt;&amp;lt; "Wrote " &amp;lt;&amp;lt; totLines &amp;lt;&amp;lt; " to the database (total of " &amp;lt;&amp;lt; totPoints &amp;lt;&amp;lt; " points) in " &amp;lt;&amp;lt; (delstart - start)/1000.0 &amp;lt;&amp;lt; "s" &amp;lt;&amp;lt; endl;
&lt;/J&gt;&lt;/J&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:31:56 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214871#M387</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2021-12-11T10:31:56Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214872#M388</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;More test results.&amp;nbsp; This time I've compiled it for both x86/x64 and compiled it against the debug and release library versions.&amp;nbsp; Tests are writing 10k lines each with 1 part and 6 vertices, then deleting all lines.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;
Beta 2:


Win32 Debug:

Wrote 10000 to the database (total of 60000 points) in 1.894s
Finished deleting all rows, time taken: 1.372s
 

x64 Debug:

Wrote 10000 to the database (total of 60000 points) in 1.078s
Finished deleting all rows, time taken: 0.806s


Win32 Release:

Wrote 10000 to the database (total of 60000 points) in 0.424s
Finished deleting all rows, time taken: 0.397s


x64 Release:

Wrote 10000 to the database (total of 60000 points) in 0.311s
Finished deleting all rows, time taken: 0.317s


Beta 3:


Win32 Debug:

Wrote 10000 to the database (total of 60000 points) in 7.247s
Finished deleting all rows, time taken: 7.061s


Win32 Release:

Wrote 10000 to the database (total of 60000 points) in 4.394s
Finished deleting all rows, time taken: 4.734s


x64 Debug:

Wrote 10000 to the database (total of 60000 points) in 5.436s
Finished deleting all rows, time taken: 5.285s


x64 Release:

Wrote 10000 to the database (total of 60000 points) in 4.898s
Finished deleting all rows, time taken: 5.301s
&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 11 Dec 2021 10:31:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214872#M388</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2021-12-11T10:31:59Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214873#M389</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thank you for identifying this issue which was also picked up by our own internal performance tests.&amp;nbsp; We've duplicated the problem and have a solution.&amp;nbsp; The issue was due to the addition of the IsEditable check to block the modification of features with advanced geodatabase behavior.&amp;nbsp; The fix will be available in the Final code drop for the File API.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 24 Mar 2011 20:44:51 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214873#M389</guid>
      <dc:creator>LanceShipman</dc:creator>
      <dc:date>2011-03-24T20:44:51Z</dc:date>
    </item>
    <item>
      <title>Re: Performance penalty with using Beta 3 version of the API</title>
      <link>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214874#M390</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;Thank you for identifying this issue which was also picked up by our own internal performance tests.&amp;nbsp; We've duplicated the problem and have a solution.&amp;nbsp; The issue was due to the addition of the IsEditable check to block the modification of features with advanced geodatabase behavior.&amp;nbsp; The fix will be available in the Final code drop for the File API.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thank you Lance.&amp;nbsp; I figured it may have something to do with the IsEditable check, as there was nothing else mentioned in beta3 updates that should have had any effect on the code.&amp;nbsp; I'm glad its a bug that will be fixed, and not just something we have to live with.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 25 Mar 2011 12:17:45 GMT</pubDate>
      <guid>https://community.esri.com/t5/file-geodatabase-api-questions/performance-penalty-with-using-beta-3-version-of/m-p/214874#M390</guid>
      <dc:creator>SasaI_</dc:creator>
      <dc:date>2011-03-25T12:17:45Z</dc:date>
    </item>
  </channel>
</rss>

