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 28093d8 commit 5b623c7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions docs/2.build/2.smart-contracts/anatomy/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ You can choose between two types of collections:

Understanding how the contract stores and loads both types of collections is crucial to decide which one to use.

:::tip
<details>

<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>.

:::
</details>

:::info How the State is Handled

Expand Down

0 comments on commit 5b623c7

Please sign in to comment.