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:
Count(Intersects((FeatureSetByName($map, "Accident"), Buffer($feature, 150, "feet")))
A more verbose way to get the same result might be:
var accidents = FeatureSetByName($map, "Accident")
var roadBuffer = Buffer($feature, 150, 'feet')
var roadAccidentIntersects = Intersects(accidents, roadBuffer)
var countAccidents = Count(roadAccidentIntersects)
return countAccidents
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.