getDistribution() requirements question / performance concern


On the platform function of .getDistribution -->

We have a line that basically says evaluate the function daily if you want the result to represent the last 12 months: interval : !period || period === ‘last12m’ ? ‘DAY’ : ‘YEAR’,

The function is almost entirely use to evaluate and render a single value per ID aggregated across the whole year, Other acceptable periods are actual Years- 2012, 2014, etc

Few questions:

  1. Is it necessary to do a daily eval to show the past 12 month result? Couldnt we do MONTH or YEAR and just aggregate the various returned values? Doing it daily is a higher tax on the function.

  2. The large performance concern is that even if we cache the DAILY result, the UI/browser is very slow to load all 365 values for the potentially 1000s of objects we are putting into the histogram.