<?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: Arcade expressions - does tighter code give better performance on AGOL? in ArcGIS Online Questions</title>
    <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007697#M37644</link>
    <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/82823"&gt;@AmyRoust&lt;/a&gt;, I marked your comment as a solution as well because you specifically call out the part of the blog that states performance won't matter with your code whether it is a single line or multi-line because of the structure of your code.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 08 Dec 2020 14:33:29 GMT</pubDate>
    <dc:creator>JoshuaBixby</dc:creator>
    <dc:date>2020-12-08T14:33:29Z</dc:date>
    <item>
      <title>Arcade expressions - does tighter code give better performance on AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007485#M37627</link>
      <description>&lt;P&gt;Has anyone tested Arcade's performance with tight vs more verbose expressions? For example, here is an expression I wrote to count the number of accidents that occurred within 150 feet of a road centerline:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;Count(Intersects((FeatureSetByName($map, "Accident"), Buffer($feature, 150, "feet")))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;A more verbose way to get the same result might be:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var accidents = FeatureSetByName($map, "Accident")
var roadBuffer = Buffer($feature, 150, 'feet')
var roadAccidentIntersects = Intersects(accidents, roadBuffer)
var countAccidents = Count(roadAccidentIntersects)
return countAccidents&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Does anyone know if one expression would perform better than the other in an AGOL pop-up? I've definitely noticed that the more you click on features in a map with spatial analysis, the faster the browser gets at calculating the results. I'm just wondering if there is an advantage to writing tight code as opposed to more readable code.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 18:43:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007485#M37627</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2020-12-07T18:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expressions - does tighter code give better performance on AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007518#M37628</link>
      <description>&lt;P&gt;Although the example you give will have more code being executed, the only real difference is variable assignment, which is trivial in terms of computing/processing.&amp;nbsp; Any difference will likely be negligible to non-existent, and what you get in return is code that is harder to read and more difficult to maintain.&amp;nbsp; Code golf can be fun, but it seldom is a performance optimization.&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 20:12:17 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007518#M37628</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-07T20:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expressions - does tighter code give better performance on AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007542#M37629</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/82823"&gt;@AmyRoust&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Some time ago I read that it is more performant to have multiple functions on the same line since this would reduce the number of requests to the server. This is something Paul Barker mentioned in his blog:&amp;nbsp;&lt;A href="https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-2/" target="_blank"&gt;https://www.esri.com/arcgis-blog/products/mapping/mapping/whats-new-with-arcade-taking-a-stroll-through-featuresets-part-2/&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;On the other hand, I have never been able to confirm this.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CC:&amp;nbsp;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/346994"&gt;@HusseinNasser2&lt;/a&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 21:31:11 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007542#M37629</guid>
      <dc:creator>XanderBakker</dc:creator>
      <dc:date>2020-12-07T21:31:11Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expressions - does tighter code give better performance on AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007551#M37633</link>
      <description>&lt;P&gt;The answer is embedded in that article that you referenced. Specifically, "&lt;SPAN&gt;Because of that lazy execution and chaining, the following two expressions are identical, and will have the same performance with respect to query execution:" The two expressions that follow are nearly identical to what I posted. Thank you - that was an interesting article.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Dec 2020 21:49:57 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007551#M37633</guid>
      <dc:creator>AmyRoust</dc:creator>
      <dc:date>2020-12-07T21:49:57Z</dc:date>
    </item>
    <item>
      <title>Re: Arcade expressions - does tighter code give better performance on AGOL?</title>
      <link>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007697#M37644</link>
      <description>&lt;P&gt;&lt;a href="https://community.esri.com/t5/user/viewprofilepage/user-id/82823"&gt;@AmyRoust&lt;/a&gt;, I marked your comment as a solution as well because you specifically call out the part of the blog that states performance won't matter with your code whether it is a single line or multi-line because of the structure of your code.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Dec 2020 14:33:29 GMT</pubDate>
      <guid>https://community.esri.com/t5/arcgis-online-questions/arcade-expressions-does-tighter-code-give-better/m-p/1007697#M37644</guid>
      <dc:creator>JoshuaBixby</dc:creator>
      <dc:date>2020-12-08T14:33:29Z</dc:date>
    </item>
  </channel>
</rss>

