WebGL Performance Issues
I've noticed a significant lag on iPads while panning. The FPS may hit 10fps.
I'm using the latest version, and it occurs when starting up this repo and when
I ran the profiler, and almost all time is spent in WebGL's drawElements (called from drawLine and drawSymbols). The example code is taking around 40ms and this repo's demo is around 270ms. To get to 60fps, this needs to run at 16ms.
From a small amount of research I've seen, it's recommended to batch these calls (e.g. with drawArrays).
Is there any work being done to address this?
I'm glad to help profile and provide anything you need, but I don't have any experience with WebGL.
We're already batching most of the drawing. I believe there's not much we can do other than general step by step performance optimizations, such as those ticketed. iPad is not a great device to do heavy WebGL rendering, because the screen size is relatively big, but the graphic capabilities are weak (at least previous generations, iPad Pro should be better).
The example code is taking around 40ms and this repo's demo is around 270ms. To get to 60fps, this needs to run at 16ms.
Can you clarify this? What are the demo and the example you're referring to? Did you measure just one frame, or panning through a certain time interval?
@c0 thanks for linking working with @danswick @tristen here for next steps based on our call yesterday commented too soon :) - looks like Vlad's already commented here 👍
@mourner thanks for elaborating and I'm excited to see optimizations in the works.
Here's how I got the profile for a specific frame. Please let me know if there's anything I can do to help.

@c0 thanks, good to know! Also note that the less layers the style has, the better is the performance — a simpler style always performs better, especially on mobile devices. You could try a style like Basic just to confirm.
@c0 From the gif it looks like this is a profile of Mobile Safari running in the iOS Simulator? Generally profiling results from the Simulator are not at all indicative of on-device performance.
@jfirebaugh Correct. I also profiled my physical iPad with similar results. drawElements is where most time is spent.
I opened a new issue that will hopefully help with perf https://github.com/mapbox/mapbox-gl-js/issues/2781 :)
Since there's not anything actionable and many other issues address perf. I'm going to close this out.