Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add sliceKeys method on dictionary types #3544

Open
bluesign opened this issue Aug 21, 2024 · 0 comments
Open

add sliceKeys method on dictionary types #3544

bluesign opened this issue Aug 21, 2024 · 0 comments

Comments

@bluesign
Copy link
Contributor

bluesign commented Aug 21, 2024

Issue to be solved

context: https://discord.com/channels/613813861610684416/1275318858005348374

Currently Cadence has problem getting keys from big dictionaries ( for example NFT Collection's ownedNFTs )

To enumerate keys, we need to traverse all dictionary and load slabs from storage, where key and value is stored together.

I think it is possible to add a sliceKeys method, as atree knows about counts under index, it should be possible to skip some keys.

Suggested Solution

add a sliceKeys method to efficiently enumerate keys in a dictionary

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant