Arcade - troubleshooting slow popup

484
1
Jump to solution
04-01-2019 05:15 AM
roemhildtg
Occasional Contributor III

Good morning. I'm troubleshooting a slow webmap popup request. The popup is occurring on a feature layer. Each time the pointer is clicked, this particular layer spawns 4 different http requests, which appears to be the cause of the delay. Anyone know more about this and how arcade impacts these requests? I have an arcade expression, that does a simple intersect lookup, but I'm seeing a lot of repeat requests.

The arcade looks like this:


```
var neighborhoods = Intersects($feature, FeatureSetByName($datastore,"Neighborhoods"));
return First(neighborhoods)['name'];
```

But the requests I'm seeing in the browser EVERY click are:
1. `.../MapServer?f=json` (root map server)
2. `.../MapServer/9/query?f=json&objectIds....etc` (this is the identify layer)
3. `.../MapServer/11?f=json` (this is the intersecting layer - repeated request)
4. .../MapServer/11/query?f=json&geometry...etc`

I guess my questions are, why do 1 and 3 have to occur every time? These are completely duplicated requests. Also, in this particular web app, I'm using feature layers and layer views in 4.x, couldn't these be queried instead of the rest endpoint to achieve a more performant query result?

I'm already doing this, but arcade appears to be querying the endpoint anyways and I'm not sure if there's a workaround.

0 Kudos
1 Solution

Accepted Solutions
XanderBakker
Esri Esteemed Contributor

As far as I understand from the blog by Paul Barker (see link below), you should try to nest statements to reduce the REST calls (which up to some extend you are already doing): 

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/whats-new-with-arcade-taking-a-strol... 

return First(Intersects($feature, FeatureSetByName($datastore,"Neighborhoods")))['name'];

View solution in original post

1 Reply
XanderBakker
Esri Esteemed Contributor

As far as I understand from the blog by Paul Barker (see link below), you should try to nest statements to reduce the REST calls (which up to some extend you are already doing): 

https://www.esri.com/arcgis-blog/products/arcgis-online/mapping/whats-new-with-arcade-taking-a-strol... 

return First(Intersects($feature, FeatureSetByName($datastore,"Neighborhoods")))['name'];