-
Notifications
You must be signed in to change notification settings - Fork 241
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
Investigate .expect
potentially pulling in format code
#746
Comments
Hi @frol I would like to be assigned this issue. |
Hi @frol, I got busy over the weekend.
Yes it does, internally
This does seem to increase code size as stated in the rustwasm book. The book mentions to use something like: #![allow(unused_variables)]
fn main() {
#[inline]
pub fn unwrap_abort<T>(o: Option<T>) -> T {
use std::process;
match o {
Some(t) => t,
None => process::abort(),
}
}
} Stating:
But this would likely make us lose the message in On side note i was able to decrease the wasm file size by just adding: [profile.release]
opt-level = 's'
codegen-units = 1 I can make a pr if needed. |
@sn99 Well, sure, we already have How big is the impact on the Wasm binary size afterall? My guess is that near-sdk-rs pulls it a ton of code that has
These are recommended options when creating a new project: https://docs.near.org/sdk/rust/get-started#create-a-new-project, but since you mention it, I believe we missed to overcommunicate it enough. Where would you want to add it? |
Hi @frol can I work on this issue? it seems the previous assignees was inactive for a while. |
@TropicalDog17 Sure. Reassigned it to you |
Hi @frol, after replacing std |
@TropicalDog17 That is insignificant. Please, try replacing all near-sdk-rs/near-sdk-macros/src/core_impl/code_generator/impl_item_method_info.rs Lines 122 to 127 in 0f46b0d
|
@TropicalDog17 I reviewed the PR, let's continue the discussion there |
Related to #745 (comment)
Investigate whether the following
.expect
call is pulling formatting code which would increase the code size:The text was updated successfully, but these errors were encountered: