We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
[perf] wasm is not using resizable array buffer.
use wasm_bindgen::prelude::wasm_bindgen; #[wasm_bindgen] pub fn hello() -> Vec<u8> { vec![0u8; 42] }
Import generated wasm module and inspect wasm memory.
Find wasm is not using resizable array buffer.
> mod.__wasm.memory.buffer.resizable false > mod.__wasm.memory.buffer.byteLength 1114112 > void (ab0 = mod.__wasm.memory.buffer) undefined
Call small allocation related fn first time.
ArrayBuffer is NOT same object.
> void mod.hello() undefined > mod.__wasm.memory.buffer.byteLength 1179648 > void (ab1 = mod.__wasm.memory.buffer) undefined > ab1 === ab0 false
Call small allocation related fn second time.
ArrayBuffer is same object.
> void mod.hello() undefined > mod.__wasm.memory.buffer.byteLength 1179648 > void (ab2 = mod.__wasm.memory.buffer) undefined > ab2 === ab1 true
> 1179648 - 1114112 65536
When actual allocation, wasm memory buffer is same ArrayBuffer .
When actual allocation, wasm memory buffer is NOT same ArrayBuffer .
Not sure it is done by COPY or not.
Not sure ab0 is COPY to ab1 or not.
ab0
ab1
Should have benchmark comparing with using resizable array buffer as wasm memory buffer.
The text was updated successfully, but these errors were encountered:
WebAssembly.Memory
No branches or pull requests
Describe the Bug
[perf] wasm is not using resizable array buffer.
Steps to Reproduce
Import generated wasm module and inspect wasm memory.
Find wasm is not using resizable array buffer.
Call small allocation related fn first time.
ArrayBuffer is NOT same object.
Call small allocation related fn second time.
ArrayBuffer is same object.
Expected Behavior
When actual allocation, wasm memory buffer is same ArrayBuffer .
Actual Behavior
When actual allocation, wasm memory buffer is NOT same ArrayBuffer .
Not sure it is done by COPY or not.
Additional Context
Not sure
ab0
is COPY toab1
or not.Should have benchmark comparing with using resizable array buffer as wasm memory buffer.
The text was updated successfully, but these errors were encountered: