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
The goal is to create a Map for Plutus Tx that is encoded in BuiltinData. In contrast, PlutusTx.AssocMap wraps a regular list encoded in SOP.
Using AsData on PlutusTx.AssocMap won’t be effective, because it is backed by a regular (SOP-encoded) list, not a data-encoded list. If we simply wrap the PlutusTx.AssocMap.Map definition in AsData, it would become less, not more efficient, because two frequent operations, wrapping and unwrapping (via toList and fromList ) will be linear (converting an SOP list to or from Data).
Instead, we should implement all operations for the new Map type such that they do not involve regular lists.
I have an initial implementation but didn’t finish addressing all the comments: #5701 Please take it from there.
Once we are done with Map, we will be ready to wrap the ScriptContext types (for V1, V2 and V3) in AsData, which will significantly speed up scripts that only access a small portion of the script context.
AsData doc: #5729
The goal is to create a Map for Plutus Tx that is encoded in BuiltinData. In contrast, PlutusTx.AssocMap wraps a regular list encoded in SOP.
Using AsData on PlutusTx.AssocMap won’t be effective, because it is backed by a regular (SOP-encoded) list, not a data-encoded list. If we simply wrap the PlutusTx.AssocMap.Map definition in AsData, it would become less, not more efficient, because two frequent operations, wrapping and unwrapping (via toList and fromList ) will be linear (converting an SOP list to or from Data).
Instead, we should implement all operations for the new Map type such that they do not involve regular lists.
I have an initial implementation but didn’t finish addressing all the comments: #5701 Please take it from there.
Once we are done with Map, we will be ready to wrap the ScriptContext types (for V1, V2 and V3) in AsData, which will significantly speed up scripts that only access a small portion of the script context.
Extricated from https://input-output.atlassian.net/browse/PLT-7744
The text was updated successfully, but these errors were encountered: