<?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 GeometryEngine.Distance much slower since Pro 3.3 in ArcGIS Pro SDK Questions</title>
    <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668334#M13274</link>
    <description>&lt;P&gt;I recently noticed that a process I developed using the Pro SDK and does a lot of geometry queries and updates was running much slower on Pro 3.3 compared to the same code running on Pro 3.1.&amp;nbsp; I found a similar performance issue when testing some tools on Pro 3.6 as well.&amp;nbsp; As I was reviewing where the tool was taking the most time, I found it was in the processes that do a lot of testing for distances between feature geometries.&amp;nbsp; Specifically the GeometryEngine.Distance method.&amp;nbsp; I did some testing and found that using a sample of 5,770 features and testing the distance to a MapPoint in Pro 3.1 completes in about 100ms.&amp;nbsp; This same code running on Pro 3.3 takes about 6 seconds.&amp;nbsp; That's 60x slower.&amp;nbsp; As noted, I also have a current Pro 3.6 system and the performance seems similar to 3.3 there but they are different systems so not apples to apples.&amp;nbsp; I then installed Pro 3.2.0 through 3.2.5 on the same system as the 3.1 and 3.3 tests and those were similar to Pro 3.1.&amp;nbsp; So it seems this change started with Pro 3.3 and has continued since.&lt;/P&gt;&lt;P&gt;I'm assuming there was some reason for the change.&amp;nbsp; Hopefully to improve the accuracy of the result.&amp;nbsp; But the performance hit is huge making it unusable for doing any bulk processing needing to know distances.&amp;nbsp; Another test I tried was to use the GeometryEngine.NearestPoint method.&amp;nbsp; This also provides a distance result as well along with other information.&amp;nbsp; This at least is about twice as fast as DistanceTo completing in about 3 seconds.&amp;nbsp; But that's also what I see in Pro 3.1 where NearestPoint is also faster than DistanceTo completing the test in 70ms.&amp;nbsp; I haven't yet found a way to get a fast performing test between geometries to know if they are within a tolerance or to find out which is the closest.&lt;/P&gt;&lt;P&gt;Is this an expected result?&amp;nbsp; If so, does anyone have any recommendations for other ways to test for distances that would be as performant as this all was before Pro 3.3?&amp;nbsp; Thanks.&lt;/P&gt;</description>
    <pubDate>Mon, 24 Nov 2025 22:24:53 GMT</pubDate>
    <dc:creator>BillyBuerger</dc:creator>
    <dc:date>2025-11-24T22:24:53Z</dc:date>
    <item>
      <title>GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668334#M13274</link>
      <description>&lt;P&gt;I recently noticed that a process I developed using the Pro SDK and does a lot of geometry queries and updates was running much slower on Pro 3.3 compared to the same code running on Pro 3.1.&amp;nbsp; I found a similar performance issue when testing some tools on Pro 3.6 as well.&amp;nbsp; As I was reviewing where the tool was taking the most time, I found it was in the processes that do a lot of testing for distances between feature geometries.&amp;nbsp; Specifically the GeometryEngine.Distance method.&amp;nbsp; I did some testing and found that using a sample of 5,770 features and testing the distance to a MapPoint in Pro 3.1 completes in about 100ms.&amp;nbsp; This same code running on Pro 3.3 takes about 6 seconds.&amp;nbsp; That's 60x slower.&amp;nbsp; As noted, I also have a current Pro 3.6 system and the performance seems similar to 3.3 there but they are different systems so not apples to apples.&amp;nbsp; I then installed Pro 3.2.0 through 3.2.5 on the same system as the 3.1 and 3.3 tests and those were similar to Pro 3.1.&amp;nbsp; So it seems this change started with Pro 3.3 and has continued since.&lt;/P&gt;&lt;P&gt;I'm assuming there was some reason for the change.&amp;nbsp; Hopefully to improve the accuracy of the result.&amp;nbsp; But the performance hit is huge making it unusable for doing any bulk processing needing to know distances.&amp;nbsp; Another test I tried was to use the GeometryEngine.NearestPoint method.&amp;nbsp; This also provides a distance result as well along with other information.&amp;nbsp; This at least is about twice as fast as DistanceTo completing in about 3 seconds.&amp;nbsp; But that's also what I see in Pro 3.1 where NearestPoint is also faster than DistanceTo completing the test in 70ms.&amp;nbsp; I haven't yet found a way to get a fast performing test between geometries to know if they are within a tolerance or to find out which is the closest.&lt;/P&gt;&lt;P&gt;Is this an expected result?&amp;nbsp; If so, does anyone have any recommendations for other ways to test for distances that would be as performant as this all was before Pro 3.3?&amp;nbsp; Thanks.&lt;/P&gt;</description>
      <pubDate>Mon, 24 Nov 2025 22:24:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668334#M13274</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2025-11-24T22:24:53Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668452#M13276</link>
      <description>&lt;P&gt;Hi Billy, thanks for the information. I will take a look. Are you able to share your data?&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 14:37:52 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668452#M13276</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2025-11-25T14:37:52Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668455#M13277</link>
      <description>&lt;P&gt;I can try to pull together the specific data I was testing with.&amp;nbsp; But it doesn't appear to be a data specific issue.&amp;nbsp; You should be able to take any data and use the GeometryEngine.Distance method between geometries and run that same test on &amp;lt; Pro 3.3 and &amp;gt;= Pro 3.3 and see the difference in the execution times.&lt;/P&gt;&lt;P&gt;To add an additional item to the list, I was also doing some testing with the Buffer method and found a similar performance issue between Pro 3.1 which was very fast and 3.3 which was much slower.&amp;nbsp; But Buffer on Pro 3.6 seemed to be back to being fast again.&amp;nbsp; So for cases where I was using the Distance method to test for distances within a tolerance, Buffer is a good replacement assuming I can run on the latest version of Pro.&amp;nbsp; I have at least one project I'm working on which is currently targeting Pro 3.3.&amp;nbsp; So I'm stuck with that version for the time being.&amp;nbsp; In other cases where I need the distance or NearestPoint, buffer won't help me with that.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 14:52:54 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668455#M13277</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2025-11-25T14:52:54Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668559#M13278</link>
      <description>&lt;P&gt;I see. I will let you know what I find out.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Nov 2025 18:02:23 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1668559#M13278</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2025-11-25T18:02:23Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1669468#M13285</link>
      <description>&lt;P&gt;I spent some time and built out a number of identical VMs each with a different version of ArcGIS Pro installed.&amp;nbsp; I took the Naperville sample data and pulled out 5,000 points from that data (see attached) and ran some geometry methods between the points and noted the total time to complete.&amp;nbsp; The results can be seen here along with a comparison of the difference between Pro 3.1 and the other versions...&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="GeometryPerformance.png" style="width: 663px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/144612i9C3A321CC3D7E132/image-size/large?v=v2&amp;amp;px=999" role="button" title="GeometryPerformance.png" alt="GeometryPerformance.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;Here's the code that does the calculations...&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;await QueuedTask.Run(() =&amp;gt;
{
   var Layer = MapView.Active.Map.GetLayersAsFlattenedList().First();
   var FeatLayer = Layer as BasicFeatureLayer;
   var Feat = null as Feature;
   var Point = null as MapPoint;
   var TestFeats = new List&amp;lt;Feature&amp;gt;();
   var TestPoints = new List&amp;lt;MapPoint&amp;gt;();

   var Time1 = DateTime.Now.Ticks;

   using (var Cursor = FeatLayer.Search())
   {
      // First feature is our test point
      Cursor.MoveNext();
      Feat = Cursor.Current as Feature;
      Point = Feat.GetShape() as MapPoint;

      while (Cursor.MoveNext())
      {
         var TestFeat = Cursor.Current as Feature;
         TestFeats.Add(TestFeat);
         TestPoints.Add(TestFeat.GetShape() as MapPoint);
      }
   }

   var Time2 = DateTime.Now.Ticks;

   foreach (var TestPoint in TestPoints)
   {
      var Dist = GeometryEngine.Instance.Distance(TestPoint, Point);
   }

   var Time3 = DateTime.Now.Ticks;

   foreach (var TestPoint in TestPoints)
   {
      var NearPoint = GeometryEngine.Instance.NearestPoint(TestPoint, Point);
   }

   var Time4 = DateTime.Now.Ticks;

   foreach (var TestPoint in TestPoints)
   {
      var Buffer = GeometryEngine.Instance.Buffer(TestPoint, 5);
      var Int = GeometryEngine.Instance.Intersects(Buffer, Point);
   }

   var Time5 = DateTime.Now.Ticks;

   var CursorTime = new TimeSpan(Time2 - Time1);
   var DistanceTime = new TimeSpan(Time3 - Time2);
   var NearestTime = new TimeSpan(Time4 - Time3);
   var BufferTime = new TimeSpan(Time5 - Time4);

   var Result = $"Points:   {TestPoints.Count:#,0}\n" +
                  $"Cursor:   {CursorTime.TotalMilliseconds:0.00}ms\n" +
                  $"Distance: {DistanceTime.TotalMilliseconds:0.00}ms\n" +
                  $"Nearest:  {NearestTime.TotalMilliseconds:0.00}ms\n" +
                  $"Buffer:   {BufferTime.TotalMilliseconds:0.00}ms\n";

   System.Diagnostics.Debug.WriteLine(Result);
   MessageBox.Show(Result);
});&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The first thing I noticed that this test takes a little over 1 second for the Distance method compared to my previous tests that was taking about 100ms which is 10x slower.&amp;nbsp; Not sure what is different between that data and the code I was using that accounts for this difference.&amp;nbsp; Everything seems to be the same.&amp;nbsp; So it makes the difference between versions less extreme.&amp;nbsp; But the differences are still there.&amp;nbsp; Pro 3.1 and 3.2 are essentially the same.&amp;nbsp; Pro 3.3 and 3.4 are about 3x slower for the three geometry methods I tested, Distance, NearestPoint and Buffer.&amp;nbsp; I also included a Intersects check with the Buffer as the goal of using these methods are to determine features within distances.&amp;nbsp; The buffer needs that additional check so I included it.&amp;nbsp; Pro 3.5 and 3.6 have similar issues with Distance and NearestPoint but something seems to have changed with the Buffer and it's about 10x faster than Pro 3.1.&amp;nbsp; So that's good to see.&lt;/P&gt;&lt;P&gt;Back in the day with ArcObjects, I tended to use Buffer a lot.&amp;nbsp; But the buffer method was updated at some point and became a bottleneck so I stopped using it unless I really needed it.&amp;nbsp; Often using Distance instead as that was much faster.&amp;nbsp; Fast forward to Pro 3.5+, Buffer seems to be the way to go when it's appropriate for the calculation.&amp;nbsp; I still need to know actual distances in many cases so I can't use buffer for that.&amp;nbsp; But interestingly, NearestPoint seems consistently 2x faster than Distance which seems odd.&amp;nbsp; NearestPoint does also return the distance to that nearest point so in that sense it's doing the same thing.&amp;nbsp; But I would assume NearestPoint would be doing more things potentially as for linear geometries it calculates segment and part index as well.&amp;nbsp; But I guess for a point to point, the nearest point is just the only point in the geometry (except multi-points) and it really is just calculating the distance.&amp;nbsp; This all suggests that Distance is doing something that takes more time that NearPoint isn't doing in its distance calculation.&amp;nbsp; Without knowing what that is and if it will affect my processes, I would guess NearestPoint would be the more efficient way to get the distance instead of Distance.&amp;nbsp; But of course NearestPoint still took the same performance hit that Distance did at Pro 3.3+.&lt;/P&gt;&lt;P&gt;With Buffer being pretty similar to NearestPoint in the worse cases, using Buffer to filter for general nearby queries and NearestPoint to get actual distances is the way to go.&amp;nbsp; It's still going to be bad in Pro 3.3 and 3.4 but the increase in Buffer performance in Pro 3.5+ should help balance it a little.&amp;nbsp; Of course if the performance of Distance and NearestPoint could improve back to where they were in Pro 3.2, that would be even better.&amp;nbsp; If there's any specific details about what is different between these methods and what changes were made between the Pro versions, that would be helpful to know so I can write my tools around those known parameters.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Dec 2025 22:57:48 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1669468#M13285</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2025-12-01T22:57:48Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1669729#M13288</link>
      <description>&lt;P&gt;Thank you so much for taking the time to spell it all out. This helps a lot.&lt;/P&gt;</description>
      <pubDate>Tue, 02 Dec 2025 16:20:20 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1669729#M13288</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2025-12-02T16:20:20Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670607#M13293</link>
      <description>&lt;P&gt;This has been fixed in 3.7, and it is faster than 3.2 now. Thanks for reporting it.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 18:23:33 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670607#M13293</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2025-12-04T18:23:33Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670664#M13294</link>
      <description>&lt;P&gt;Thanks for looking into this.&amp;nbsp; I'll test it out with 3.7 is available.&amp;nbsp; Unfortunately I doubt our customers will be on 3.7 for a while so I'll still have to try to work around this for a while.&amp;nbsp; I don't assume there will be any patch updates for these existing versions to address this?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 20:00:37 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670664#M13294</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2025-12-04T20:00:37Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670672#M13295</link>
      <description>&lt;P&gt;I will check on a patch and get back to you.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Dec 2025 20:11:36 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1670672#M13295</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2025-12-04T20:11:36Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1686289#M13456</link>
      <description>&lt;P&gt;Hi Billy, the fix is included in the 3.6.2 patch. See&amp;nbsp;&lt;A href="https://community.esri.com/t5/arcgis-pro-documents/arcgis-pro-3-6-patch-2-3-6-2-is-now-available/ta-p/1685330/jump-to/first-unread-message" target="_blank"&gt;https://community.esri.com/t5/arcgis-pro-documents/arcgis-pro-3-6-patch-2-3-6-2-is-now-available/ta-p/1685330/jump-to/first-unread-message&lt;/A&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thanks again for reporting it.&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 16:05:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1686289#M13456</guid>
      <dc:creator>AnnetteLocke</dc:creator>
      <dc:date>2026-02-24T16:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: GeometryEngine.Distance much slower since Pro 3.3</title>
      <link>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1686444#M13457</link>
      <description>&lt;P&gt;Thanks for the heads up.&amp;nbsp; I saw the 3.6.2 update just the other day but didn't check on this until just now.&amp;nbsp; Results are great and is way better then before.&amp;nbsp; This also means Distance and Nearest are now faster than Buffer which has always been my expectation.&amp;nbsp; But still good to see buffer is very fast as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="Geometry Performance 3.6.2.png" style="width: 306px;"&gt;&lt;img src="https://community.esri.com/t5/image/serverpage/image-id/148888iEF746EF70C7B1515/image-size/large?v=v2&amp;amp;px=999" role="button" title="Geometry Performance 3.6.2.png" alt="Geometry Performance 3.6.2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Feb 2026 22:29:32 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-pro-sdk-questions/geometryengine-distance-much-slower-since-pro-3-3/m-p/1686444#M13457</guid>
      <dc:creator>BillyBuerger</dc:creator>
      <dc:date>2026-02-24T22:29:32Z</dc:date>
    </item>
  </channel>
</rss>

