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

Benchmark the effect of calling ext native functions in wasm blobs written in rust #251

Open
drskalman opened this issue Jul 23, 2020 · 6 comments
Labels
review Implementation code review

Comments

@drskalman
Copy link
Contributor

We need to make a wasm blob which repeat an operation in a function inside the wasm and 2. calling out side the blob and compare the timing this is related to 425 research-internal issue.

@drskalman
Copy link
Contributor Author

Cloning https://github.com/wasmerio/wasmer-rust-example and adding stuff to it.

@drskalman
Copy link
Contributor Author

added command line arg and empty add_inside_wasm and add_outside_wasm. In wasm added simple function to add some value to a variable

@drskalman
Copy link
Contributor Author

failed to add some randomness to wasm (to protect against optimization) apparently rng in wasm is a mess. added a function to compute Fibonacci numbers but it overflow the u64 so I need to replace it with bigint.

@drskalman
Copy link
Contributor Author

  • add big num to make fibo benachi numbers computed in wasm and test everything.
  • move the addition function to the an internal wasm function.
  • move the addition function to an external addition function.

I had lots of trouble passing bigint from wasm to the ext function because wasmer doesn't have a good support to this without copying for object which do not implement copy. Then I realized that in substrate we only deal with wasmi and wasmtime and their performance might be/is different than wasmer so I'm going to change the runtime executor to either of those and refactor the code.

@FlorianFranzen FlorianFranzen added the review Implementation code review label Aug 25, 2020
@lamafab
Copy link
Contributor

lamafab commented Nov 4, 2020

@drskalman has higher priority issues for now. On hold.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
review Implementation code review
Projects
None yet
Development

No branches or pull requests

4 participants
@FlorianFranzen @drskalman @lamafab and others