I have a big and complicated static multidimensional array in PHP:
static $data = array (
'entry1' => array(
'field1' => array(
),
'field2' => array(
)
....
)
...
);
The length of var_export($data, true)
is about 2MB.
If I just want to access $array['entry1']['field1']
, the first time it takes like ~5 second. I guess the entire array needs to be loaded in memory. Is there any advice how to improve the performance? Should I split this array into smaller arrays?