Ability to set height of virtual list by giving it an array

Hi there,
i have bunch of list data which have different heights…
by using height function of virtual list, every time it have to append a list to dom, calculate height and then return height, which is slow.
another method could be adding all items at one to dom, calculate list heights as an array an give it to virtual list.
could it be possible?

heights (items) => (… return [300, 400 ,500 …])