Skip to content
CCPEDIAby Unity Nodes
Discussions/App Development/Is there a limit on a collection inside a template?Forum ↗

Is there a limit on a collection inside a template?

App Development4 posts168 views3 likesLast activity Jan 2024
CO
cohen.avrahamOP
Jan 2024

G-d willing

Hello,
Is there a limit on the size of a collection I can use inside a template?
Saying a collection of 100K elements… is that possible?
And what about updating the contract with 100K elements, how heavy-lifting will it be?

Thanks,

LU
Luciano
Jan 2024
cohen.avraham:

And what about updating the contract with 100K elements, how heavy-lifting will it be?

One thing I know is that there is no structural sharing on the ledger. So if I have a 100k element list on a contract, and I prepend one element to it, it will re-write all 101k values (unlike that same operation in memory).

CO
cohen.avraham
Jan 2024

G-d willing

Thanks @Luciano for your reply.
I am aware to the consequences of adding another element to the collection.
But, can I assume that when it reaches 200K elements, the application won’t be able to handle it due to memory limit? Generally, I would like to know when this approach is about to fail

AL
ali-abrar
Jan 2024

You might eventually hit transaction size limits, depending on how large each of these elements is. See Transaction size threshold?

← Back to Discussions