array_merge in views LeafletMap::render()

Created on 24 February 2024, 4 months ago
Updated 11 March 2024, 4 months ago

Problem/Motivation

Another one from staring a xhprof. The render loop and building the features array can be massive. With flexibility comes complexity. But there was one quick win. Merging the $features_group[] on every loop was reporting very high memory usage https://git.drupalcode.org/project/leaflet/-/blob/10.2.x/modules/leaflet... actually higher than the overall peak memory used, so maybe it gets optimised somewhat, or something? But anyway. Running one array_merge after the loop has run uses less memory.

Proposed resolution

Switch to adding the features to the features_group array in the loop, and merge them just once after the loop has finished.

Remaining tasks

Make a MR.

API changes

None.

📌 Task
Status

Fixed

Version

10.2

Component

Code

Created by

🇳🇱Netherlands ekes

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024