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

Implement no_std support for SDK #443

Open
ilblackdragon opened this issue Jun 16, 2021 · 6 comments
Open

Implement no_std support for SDK #443

ilblackdragon opened this issue Jun 16, 2021 · 6 comments

Comments

@ilblackdragon
Copy link
Member

ilblackdragon commented Jun 16, 2021

The goal is to reduce dramatically contract size.
For example contract without std can be 5-8KB
Currently this requires to not use SDK at all.

@austinabell austinabell self-assigned this Jun 16, 2021
@matklad
Copy link
Contributor

matklad commented Jun 17, 2021

I suggest profiling the memory usage first to understand what exactly is causing bloat before jumping to the solutions.

I would be surprised if std per se is a problem. My understanding is that, code-size wise, you don't pay for what you don't use in Rust/wasm. At the same time, some core functionality (formatting machinery mainly) is known to cause bloat.

The relevant tools are:

@matklad
Copy link
Contributor

matklad commented Jun 22, 2021

Just so that the link is not lost in private communication: this post shows that removing formatting machinery from an already no_std crates leads to 92% reduction in size: https://jamesmunns.com/blog/fmt-unreasonably-expensive/.

@ilblackdragon
Copy link
Member Author

ilblackdragon commented Jun 24, 2021 via email

@bowenwang1996
Copy link
Contributor

It would be rad if we can get the size of rust contracts down to 8kb

@ilblackdragon
Copy link
Member Author

ilblackdragon commented Jun 29, 2021 via email

@frol
Copy link
Collaborator

frol commented Jun 23, 2023

Just for context, I want to mention that there is an experimental no-std NEAR SDK: https://github.com/austinabell/nesdie

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: NEW❗
Development

No branches or pull requests

5 participants