updatePaintArrays got really slow on geojson with lots of paint properties
bug :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
<img width="1624" height="663" alt="Image" src="https://github.com/user-attachments/assets/857c7324-9079-455b-bf95-ae9a022537e9" />
v.3.20
<img width="1463" height="665" alt="Image" src="https://github.com/user-attachments/assets/019e47f8-fc34-400a-985c-2538b553fed4" />
thank you!
### Actual behavior
_No response_
### Link to the demonstration
_No response_
### Steps to trigger the unexpected behavior
_No response_
### Relevant log output
```shell
```
2 条评论