-
Notifications
You must be signed in to change notification settings - Fork 354
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
Replace serde json wasm #312
Conversation
@@ -29,7 +29,7 @@ backtraces = ["snafu/backtraces"] | |||
|
|||
[dependencies] | |||
base64 = "0.11.0" | |||
serde-json-wasm = "0.1.2" | |||
serde_json = { git = "https://github.com/webmaster128/serde_json_wasm", branch="float-feature" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wow. I need to look at this.
Can you put this repo under confio or cosmwasm? Let me know if you need permissions.
Two main questions:
- it seems you recompiled the contract and it worked with check_wasm. Awesome!
- gas was not affected significantly:+1:
- this increased contract size by 70kb. I wonder if you can do some size profiling. I used twilly on the output before wasm-opt. Eg just compile with the rustflags argument and see what is taking up the space... maybe there is something easy to trim out
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The current state is that cargo wasm
works perfectly but cargo +nightly wasm
still has disallowed instructions in it. I think it is related to how the different compilers handle the many #[inline]
statements from the 'serde-rs/json'. I'm in the process of kicking out much more code. Let's see
No matter what I do, starting from Rust 1.43 a seemingly unused function is created
which then calls
where we get the float instructions from. My old Rust stable did not have this issue. |
Turns out that an implementation of Look at the second parameter as well as the code around That explains the difference between the old stable builds and the nightly builds. No idea if we can trace down where |
@ethanfrey this is more or less what I do to test the resulting instructions from a local version of
|
Closes #110
At webmaster128/serde_json_wasm#1 there is a diff showing what needs to be done to remote float instructions from serde_json. I think this does the job.