2

I clearly remember that a couple of months ago when I tried to push some items into a storage array each consecutive 'array-pushing-transaction' took more gas to execute. In other words, it was increasingly expensive to use arrays. Now it seems that the things have changed -- gas calculations dont't take into account array size anymore. I'm just curious when did these changes took place and what was the reason behind such limitation?

3

If you look at storage layout with "The mapping or the dynamic array itself occupies..." you will see that all actions are O(1), keccak256 calculations and read / writes.

I do not understand where you got this increasing cost. It must have been something elsewhere in the function.

  • I have heard this exact sort of thing from otherwise well-informed sources. I think they're conflating an implied increase in the number of operations at larger scales, with increasing cost of individual operations. In other words, a hidden assumption that all algos cost more at scale and confusing that with increasing EVM costs. – Rob Hitchens - B9lab Jan 26 '17 at 0:14
  • @Xavier Leprêtre B9lab, thank you, it just dawned on me that it might have been a bug in solidity online compiler – manidos Jan 26 '17 at 3:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.