-
Notifications
You must be signed in to change notification settings - Fork 42
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
Migrate from wasmi to wasmer #5
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Note that the `WASM_SIGNATURE_TYPE_VOID` has been removed for now.
The initial function was named `wasm_read_binary`. The new name is `wasm_read_bytes`.
The value stored in the `wasm_bytes` resource has changed from `uint8_t*` to `wasmer_byte_array*`. The signature of the `wasm_new_instance` function no longer requires the Wasm binary filename. The last argument has been removed temporarily.
The function name is updated to `wasm_function_arguments_builder`. This patch also restores the `wasm_function_arguments_builder_add_i32`.
Previously named `wasm_invoke_arguments_builder_add_i64`.
… function. Previously named `wasm_invoke_arguments_builder_add_f32`.
… function. Previously named `wasm_invoke_arguments_builder_add_f64`.
Early results with the n-body benchmark. Note: I'm testing with PHP 7.3.2. Rust only$ hyperfine './nbody-rs 5000000'
Benchmark #1: ./nbody-rs 5000000
Time (mean ± σ): 287.0 ms ± 8.1 ms [User: 280.5 ms, System: 2.8 ms]
Range (min … max): 278.5 ms … 300.5 ms Pure PHP$ hyperfine 'php nbody.pure.php 5000000'
Benchmark #1: php nbody.pure.php 5000000
Time (mean ± σ): 19.761 s ± 0.842 s [User: 19.602 s, System: 0.075 s]
Range (min … max): 18.908 s … 20.915 s
|
Implementation | Time (ms) |
---|---|
Rust (baseline) | 287 |
Pure PHP | 19'761 |
php-ext-wasm with wasmi (current) |
67'622 |
php-ext-wasm with wasmer (this PR) |
2365 |
Ocramius
suggested changes
Mar 8, 2019
…nction API. This is a temporary patch.
Blocked by wasmerio/wasmer#261 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix #4.
This PR replaces
wasmi
by Wasmer through thewasmer-runtime-c-api
, and thus we will be able to use Cranelift and soon LLVM for the backend.