You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently createMerkleTree takes a list. It traverses the list first to find out the length and allocate the memory for the tree before traversing the list for computing the hashes as the input items. Depending on the type of the input list and the source and size of the input items this may pull large amount of data input memory (possibly via IO).
Instead there should be different methods for creating trees depending of whether the length of the input is know in advance or not. In the former case the current strategy should be use that makes a single allocation for the correct size of memory. In the latter case and exponential allocation strategy should be used.
The text was updated successfully, but these errors were encountered:
Currently
createMerkleTree
takes a list. It traverses the list first to find out the length and allocate the memory for the tree before traversing the list for computing the hashes as the input items. Depending on the type of the input list and the source and size of the input items this may pull large amount of data input memory (possibly via IO).Instead there should be different methods for creating trees depending of whether the length of the input is know in advance or not. In the former case the current strategy should be use that makes a single allocation for the correct size of memory. In the latter case and exponential allocation strategy should be used.
The text was updated successfully, but these errors were encountered: