Hi @DanielDormont ,
There are multiple optimizations been done behind the scenes. @JeremyBartley explained some of them on Behind the scenes, What the JS API and ArcGIS do for you.
But in summary ArcGIS API for JS use WebGL (Leaflet doesn't) plus the ArcGIS API for JS make use of all the optimizations included in the Feature Service to reduce the data transferred and produce faster responses (tile caching, PBFs encoded responses, geometry quantization, etc.) <- and as far as I know, the Esri Leaflet FeatureLayer.js doesn't as can be seen here:
There you can see how Esri Leaflet request a GeoJSON from the service, plus every time you zoom in & zoom out send a bunch of requests to retrieve only the geometries needed (but do not cache, compress or simplify them) <- it would be great if someone in the community would open a PR to help improve it (but I think there are pretty complex optimizations in the JSAPI that wouldn't be easy to replicate).
In my application we use Leaflet just because it's a bit more generic
Interesting, what do you mean by more generic? Is there anything we could ask the JSAPI team to do to make it more generic?
we were already familiar with it before we began integrating with Esri, but we have been running into similar performance issues displaying complex Feature Layers
That's a common situation. Let me know if there is anything else we can do to support you or make your life easier learning how to integrate with ArcGIS.
Cheers,
Raul