Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
gagdiez authored Oct 2, 2024
1 parent 5b623c7 commit dd5d379
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion docs/2.build/2.smart-contracts/anatomy/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Understanding how the contract stores and loads both types of collections is cru
<summary> Native vs SDK Collections </summary>

Use native collections for small amounts of data that need to be accessed all together, and SDK collections for large amounts of data that do not need to be accessed all together.

If your collection has up to 100 entries, it's acceptable to use the native collection, as it might be simpler since you don't have to manage prefixes as we do with SDK collections.
However, if your collection has 1,000 or more entries, it's better to use SDK collection. The [investigation](https://github.com/volodymyr-matselyukh/near-benchmarking) shows that running the `contains` method on a native HashSet<i32> consumes 41% more gas compared to SDK IterableSet<i32>.

However, if your collection has 1,000 or more entries, it's better to use SDK collection. [This user test](https://github.com/volodymyr-matselyukh/near-benchmarking) shows that running the `contains` method on a native HashSet<i32> consumes 41% more gas compared to SDK IterableSet<i32>.

</details>

Expand Down

0 comments on commit dd5d379

Please sign in to comment.