<?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: MapPoint woes in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1209626#M11313</link>
    <description>&lt;P&gt;Hello Michael!&amp;nbsp; In general, the fastest way to create point Graphics in Runtime is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Construct a Graphic using the attribute-only constructor.&lt;/LI&gt;&lt;LI&gt;Construct a MapPoint from coordinates and set Graphic.Geometry property.&lt;/LI&gt;&lt;LI&gt;Populate a List with Graphics and then add them to a GraphicsOverlay all at once.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Some performance best practices and micro-optimizations to follow:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a Renderer on the GraphicsOverlay instead of manually assigning a Symbol to each Graphic.&lt;/LI&gt;&lt;LI&gt;Use as few attributes as possible for each Graphic.&amp;nbsp; Only set attributes necessary to identify and render the Graphic.&amp;nbsp; It's more efficient to keep other attributes in SQLite or at least in a Dictionary, than to copy them into Graphics.&amp;nbsp; EF queries should also get faster if fewer attributes need to be projected.&lt;/LI&gt;&lt;LI&gt;Use Graphic constructor that takes a Dictionary of attributes instead of individually adding them on the Attributes after construction.&lt;/LI&gt;&lt;LI&gt;Avoid MapPointBuilder if performance matters -- it's significantly slower than constructing MapPoints directly, and only exists for the sake of rounding out GeometryBuilder API.&lt;/LI&gt;&lt;LI&gt;Use a SpatialReference that matches the Map, ideally a common one (e.g. &lt;A href="https://developers.arcgis.com/net/api-reference/api/netstandard/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.SpatialReferences.Wgs84.html" target="_self"&gt;SpatialReferences.Wgs84&lt;/A&gt; or &lt;A href="https://developers.arcgis.com/net/api-reference/api/netstandard/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.SpatialReferences.WebMercator.html" target="_self"&gt;SpatialReferences.WebMercator&lt;/A&gt;).&amp;nbsp; This avoids the overhead of datum conversion and reprojection.&lt;/LI&gt;&lt;LI&gt;To create Graphic with point geometry, prefer setting the Graphic.Geometry property.&amp;nbsp; This setter uses a special optimized codepath, originally created with animated/moving Graphics in mind, that's even faster than Graphic constructors that take Geometry.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Use GraphicsOverlay.Graphics.AddRange(...) instead of adding graphics one at a time.&lt;/LI&gt;&lt;LI&gt;Upgrade to modern versions of .NET if possible -- the new net6.0 runtime is &lt;EM&gt;significantly&lt;/EM&gt; faster than .NET Framework and Mono.&lt;/LI&gt;&lt;/UL&gt;&lt;P data-unlink="true"&gt;You can find more performance advice in this recently-updated developer guide topic:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/programming-patterns/performance-considerations/" target="_self"&gt;Performance considerations&lt;/A&gt;.&amp;nbsp; You can also check out this &lt;A href="https://devsummit2022.esri.com/flow/esri/epcds/2022devsummitproceedings/page/proceedings/session/1645210555422001jf4G" target="_self"&gt;10-minute demo from DevSummit 2022&lt;/A&gt; that focused on Graphic performance (relevant part starts around&amp;nbsp;&lt;SPAN&gt;22:30).&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I would also encourage you to measure which parts of the process account for most time, and to check the official&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/ef/core/performance/" target="_self"&gt;EFCore performance tips&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I would be glad to look into specifics of your app to see how we can help achieve better performance!&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Wed, 07 Sep 2022 17:10:27 GMT</pubDate>
    <dc:creator>MatveiStefarov</dc:creator>
    <dc:date>2022-09-07T17:10:27Z</dc:date>
    <item>
      <title>MapPoint woes</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1209320#M11305</link>
      <description>&lt;P&gt;We've got an in-progress Xamarin Forms 5 app where we need to load ~48k structure points from Entity Framework/sqlite (via direct SQL query) and present them on a map via Graphics Overlays.&lt;/P&gt;&lt;P&gt;The MapPoint constructor seems to be rather expensive, taking roughly 20 seconds to cycle through the structures. &amp;nbsp;Adding the created MapPoints to Graphics Overlays and presenting them on the map is extremely fast, it's just the initial creation of the points that is slowing things down.&lt;/P&gt;&lt;P&gt;We've looked into somehow persisting the MapPoint object however despite having JSON import/export functions the object itself is not serializable so we can't keep them around between sessions. &amp;nbsp;This is put us in a bit of a quandary where we are having to pull UI tricks and alter workflows do disguise the poor performance when loading the structures into the map.&lt;/P&gt;&lt;P&gt;Any ideas on how we might be able store and retrieve MapPoint objects on mobile? &amp;nbsp;Any chance we might be able to actually serialize geometry objects? &amp;nbsp;Our spec requires licensing at the Lite level so we can't do a local Mobile Geodatabase to stash points, and we've tried various alternate methods of generating points (PointBuilder, from JSON, from Coordinate String) but they all seem to have the same performance issue.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Sep 2022 19:15:14 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1209320#M11305</guid>
      <dc:creator>MichaelDavis3</dc:creator>
      <dc:date>2022-09-02T19:15:14Z</dc:date>
    </item>
    <item>
      <title>Re: MapPoint woes</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1209626#M11313</link>
      <description>&lt;P&gt;Hello Michael!&amp;nbsp; In general, the fastest way to create point Graphics in Runtime is:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;Construct a Graphic using the attribute-only constructor.&lt;/LI&gt;&lt;LI&gt;Construct a MapPoint from coordinates and set Graphic.Geometry property.&lt;/LI&gt;&lt;LI&gt;Populate a List with Graphics and then add them to a GraphicsOverlay all at once.&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;Some performance best practices and micro-optimizations to follow:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use a Renderer on the GraphicsOverlay instead of manually assigning a Symbol to each Graphic.&lt;/LI&gt;&lt;LI&gt;Use as few attributes as possible for each Graphic.&amp;nbsp; Only set attributes necessary to identify and render the Graphic.&amp;nbsp; It's more efficient to keep other attributes in SQLite or at least in a Dictionary, than to copy them into Graphics.&amp;nbsp; EF queries should also get faster if fewer attributes need to be projected.&lt;/LI&gt;&lt;LI&gt;Use Graphic constructor that takes a Dictionary of attributes instead of individually adding them on the Attributes after construction.&lt;/LI&gt;&lt;LI&gt;Avoid MapPointBuilder if performance matters -- it's significantly slower than constructing MapPoints directly, and only exists for the sake of rounding out GeometryBuilder API.&lt;/LI&gt;&lt;LI&gt;Use a SpatialReference that matches the Map, ideally a common one (e.g. &lt;A href="https://developers.arcgis.com/net/api-reference/api/netstandard/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.SpatialReferences.Wgs84.html" target="_self"&gt;SpatialReferences.Wgs84&lt;/A&gt; or &lt;A href="https://developers.arcgis.com/net/api-reference/api/netstandard/Esri.ArcGISRuntime/Esri.ArcGISRuntime.Geometry.SpatialReferences.WebMercator.html" target="_self"&gt;SpatialReferences.WebMercator&lt;/A&gt;).&amp;nbsp; This avoids the overhead of datum conversion and reprojection.&lt;/LI&gt;&lt;LI&gt;To create Graphic with point geometry, prefer setting the Graphic.Geometry property.&amp;nbsp; This setter uses a special optimized codepath, originally created with animated/moving Graphics in mind, that's even faster than Graphic constructors that take Geometry.&amp;nbsp;&lt;/LI&gt;&lt;LI&gt;Use GraphicsOverlay.Graphics.AddRange(...) instead of adding graphics one at a time.&lt;/LI&gt;&lt;LI&gt;Upgrade to modern versions of .NET if possible -- the new net6.0 runtime is &lt;EM&gt;significantly&lt;/EM&gt; faster than .NET Framework and Mono.&lt;/LI&gt;&lt;/UL&gt;&lt;P data-unlink="true"&gt;You can find more performance advice in this recently-updated developer guide topic:&amp;nbsp;&lt;A href="https://developers.arcgis.com/net/programming-patterns/performance-considerations/" target="_self"&gt;Performance considerations&lt;/A&gt;.&amp;nbsp; You can also check out this &lt;A href="https://devsummit2022.esri.com/flow/esri/epcds/2022devsummitproceedings/page/proceedings/session/1645210555422001jf4G" target="_self"&gt;10-minute demo from DevSummit 2022&lt;/A&gt; that focused on Graphic performance (relevant part starts around&amp;nbsp;&lt;SPAN&gt;22:30).&lt;/SPAN&gt;&lt;/P&gt;&lt;P data-unlink="true"&gt;&lt;SPAN&gt;I would also encourage you to measure which parts of the process account for most time, and to check the official&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/ef/core/performance/" target="_self"&gt;EFCore performance tips&lt;/A&gt;.&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;I would be glad to look into specifics of your app to see how we can help achieve better performance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Sep 2022 17:10:27 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1209626#M11313</guid>
      <dc:creator>MatveiStefarov</dc:creator>
      <dc:date>2022-09-07T17:10:27Z</dc:date>
    </item>
    <item>
      <title>Re: MapPoint woes</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1210065#M11316</link>
      <description>&lt;P&gt;Thanks for your response - implemented all of your suggestions (including minimizing fields coming from EF) and brought the load time down from 20-40sec to 2 seconds flat.&lt;/P&gt;&lt;P&gt;Unfortunately this project requires AppCenter and MSAL - which are total no-go for MAUI right now so .net 6 is off the table. &amp;nbsp;Looking forward to checking out the performance improvements once MAUI is a little more mature.. maybe .net 7 at this point.&lt;/P&gt;</description>
      <pubDate>Tue, 06 Sep 2022 19:48:18 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/mappoint-woes/m-p/1210065#M11316</guid>
      <dc:creator>MichaelDavis3</dc:creator>
      <dc:date>2022-09-06T19:48:18Z</dc:date>
    </item>
  </channel>
</rss>

