onflow / atree

Atree provides scalable arrays and scalable ordered maps.
https://onflow.org
Apache License 2.0
39 stars 13 forks source link

Add feature to support mutation of primitive values returned by iterators #356

Closed fxamacker closed 4 months ago

fxamacker commented 7 months ago

This feature can be used to speed up both Atree Storage Migration and Cadence migration.

Without this feature, we currently need 2 iterations to update values. The first iteration is to gather all the map keys. Second is to update values by key.

We can reduce the 2 iterations to just 1 iteration. This will speedup migration of many values within large accounts by eliminating an iteration. However, mutable iterations by itself will be somewhat slower than the old way of iterating.

Some discussion about this was on Discord.

fxamacker commented 4 months ago

Closed by #359