PreAllocateRepList in Replication graph

332346-preallocate.png

I know this is not necessary to PreAllocateRepList as it will automatically happen on demand and also that it will create 12, 12 and 64 lists of length 3, 6 and 128 respectively.

But what does it do? What is the main motive of this and what happens behind the scene?

Please explain in detail as there is no proper documentation for replication graph.

Hey Harshdev Singh,

I think from what I have seen is first param, ListSize, is how size or the number of items in the RepList and the second param, NumLists, is how many such size RepList are you assuming your game will use. Again it is not totally required to do this but it will warn you if any RepList is using larger size than you expect and you need to optimize that area of your code to reduce the size of the RepList.

Just to quote from another website I read (UE4-ReplicationGraph source code analysis-basic - Programmer Sought):

Call PreAllocateRepList to build 12 lists of size 3, 12 lists of size 6 and 64 lists of size 128