I suggest to calculate the array and save it to a transient field once (on save/load) to decrease the performance impact