From 5b623c767e7cb7ab7f27331324046b4a36d320d0 Mon Sep 17 00:00:00 2001 From: Guille Date: Wed, 2 Oct 2024 13:06:58 +0200 Subject: [PATCH] Apply suggestions from code review --- docs/2.build/2.smart-contracts/anatomy/collections.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docs/2.build/2.smart-contracts/anatomy/collections.md b/docs/2.build/2.smart-contracts/anatomy/collections.md index 996c42894c..787bdf15d1 100644 --- a/docs/2.build/2.smart-contracts/anatomy/collections.md +++ b/docs/2.build/2.smart-contracts/anatomy/collections.md @@ -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 +
+ + Native vs SDK Collections 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 consumes 41% more gas compared to SDK IterableSet. -::: +
:::info How the State is Handled