Giovanni S | Flow (2024-04-05)
How computationally expensive is calling
someArray.length
- does it require enumeration over the entire array or is it constant time?7 Replies
I've created a thread for your message. Please continue any relevant discussion in this thread.
You can rename this thread using
/title <new title>
If this is a technical question that others may benefit from, considering also asking it on Stackoverflow: https://stackoverflow.com/questions/ask?tags=onflow-cadenceIt's constant time, it's cheap
Is that also the case for dictionaries? I thought there were previously concerns about computation required to get
someMapping.length
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View
Amazing, thank you. I'll need to play around with it
No, AFAIK the length is stored in the root. cc @Faye | Flow
Unknown User•8mo ago
Message Not Public
Sign In & Join Server To View