Optimization: Fast List Traversal #333
Labels
bb: medium
Medium issue according to bug bounty categorization
bug bounty
This issue is prized out as part of the Bug Bounty Program
enhancement
New feature or request
Is your feature request related to a problem? Please describe.
List accesses in uplc are linear in n. While you can not reduce the number of tailList operations, you can reduce the number of index comparisons to reduce the cost of execution.
Describe the solution you'd like
A similar to solution to
list_at_index
could be implemented in the opshin implementation oflist[x]
. The step size could be configurable but likely 5 is a good heuristic for most data that is on-chain.Describe alternatives you've considered
None
Additional context
This could go together with #168 in one of the higher optimization levels.
The text was updated successfully, but these errors were encountered: