use-ink / ink-docs

Documentation portal for the ink! smart contract language.
https://use.ink
Creative Commons Zero v1.0 Universal
23 stars 70 forks source link

Document dynamic memory allocator trade-offs #24

Open HCastano opened 3 years ago

HCastano commented 3 years ago

After https://github.com/paritytech/ink/pull/831 is merged there will be two choices for dynamic memory allocators in ink!. The default is the new bump allocator while the other choice is wee_alloc (which used to be the old default).

The fundamental tradeoff here is .wasm size vs. efficient use of memory.

For someone concerned with running smart contracts on a parachain, size would be the most important consideration. However, if someone is running a standalone chain then memory efficiency might be more important.

The guide should explain:

SkymanOne commented 1 year ago

Do we still allow choosing an allocator?

HCastano commented 1 year ago

Yes we do.

I have a recent PR around this: https://github.com/paritytech/ink/pull/1661.

If we want to add a section around this in the ink-docs it can basically be a copy-paste of the documentation I wrote in that PR.

SkymanOne commented 1 year ago

Yes. Can you please add it to the docs?

HCastano commented 1 year ago

No promises on the timelines though