I observed a severe performance regression (>10脳) on macOS/GLFW and bisected it to https://github.com/mapbox/mapbox-gl-native/pull/9676. The performance regression is also present on iOS:
| name | before | after |
| --- | --- | --- |
| paris | 55.5 fps | 29.4 fps |
| paris2 | 54.6 fps | 38.7 fps |
| alps | 25.9 fps | 15.7 fps |
| us east | 60.2 fps | 60.3 fps |
| greater la | 50.7 fps | 38.5 fps |
| sf | 60.0 fps | 48.0 fps |
| oakland | 59.9 fps | 38.1 fps |
| germany | 30.3 fps | 17.6 fps |
Likely, this is because LineLayoutVertex jumped from 8 to 10 bytes, which means it's no longer aligned on a 4 byte boundary. Unaligned access typically causes a severe slowdown in the GPU, or causes the driver to rewrite the buffers before uploading them internally.
/cc @jfirebaugh
It was 12 bytes originally, but I changed it to 10 because @mourner was concerned about the added size. I guess we'll have to go back to 12.
@kkaefer What model of device are your results from? I couldn't reproduce this on my iPhone 6. Can you test https://github.com/mapbox/mapbox-gl-native/compare/line-vertex-alignment?
I used the iPad mini 2 for gathering these numbers. However, I also observed this effect in macOS with GLFW dropping from 60fps to ~10fps).
| name | 7dbec98caf69233a59d1cc03a374f77cbd59ff1f |
| --- | --- |
| paris | 54.5 fps |
| paris2 | 51.4 fps |
| alps | 24.9 fps |
| us east | 60.2 fps |
| greater la | 49.4 fps |
| sf | 60.0 fps |
| oakland | 59.9 fps |
| germany | 29.2 fps |
performance is back :)