#13674·mapbox-gl-js

updatePaintArrays got really slow on geojson with lots of paint properties

Author: sboivinsystraCreated Jun 1, 2026Updated Sep 25, 2026
Labelsbug :lady_beetle:performance :zap:

mapbox-gl-js version

v3.21, v3.24.0

Browser and version

firebox 151.0.2

Expected behavior

Hi. I have a geojson Line layer with many paint properties. (line-color, line-opacity, line-width, line-blur). There are also expression on those ex:

'line-color': ['case', ['boolean', ['feature-state', 'select'], false], '#87FFF3', ['case', ['has', 'route_color'], ['concat', '#', ['get', 'route_color']],'#4b88fa']],

when i update a paint property it's now really slow map.setPaintProperty('my-layer', 'line-opacity', 0.5);

It now take 3600ms while it took 400ms before v3.21.

The function "updatePaintArrays" looks to be the problem.

I tested i bit and The slowdown seems to only happen when there are expressions in the paint properties. Like mapbox now have to reevaluate every expression on every geojson features when I change the opacity.

here are screenshots of the firefox's performance flameGraphs. issue is still present on v3.24.0 v3.21 Image

v.3.20 Image

thank you!

Actual behavior

No response

Link to the demonstration

No response

Steps to trigger the unexpected behavior

No response

Relevant log output

bash