-
Notifications
You must be signed in to change notification settings - Fork 36
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
Troubleshoot AssemblyScript performance #12
Comments
|
Also as-wasi uses |
@MaxGraey Thanks for the heads up, it does run several seconds faster with that fix. |
this issue also will be fixed soon |
Arrays and TypedArrays have special property for point to started data called // @ts-ignore: decorator
@inline
function getArrayPtr<T>(data: T[]): usize {
return data.dataStart;
}
// @ts-ignore: decorator
@inline
function getTypedArrayPtr(data: ArrayBufferView): usize { // ArrayBufferView is base class for Uint8Array and etc
return data.dataStart; // it also take into account data.byteOffset
} |
Good to know! I think had read somewhere (or deduced from AssemblyScript/assemblyscript#743) that it was an unstable, undocumented thing. But now I actually see it in the the docs so it looks like we can simplify a bit. |
As mentioned in bytecodealliance#12 (comment), it is acceptable to use the `dataStart` field.
As mentioned in bytecodealliance#12 (comment), it is acceptable to use the `dataStart` field.
As mentioned in #12 (comment), it is acceptable to use the `dataStart` field.
Why is the AssemblyScript example slower than the Rust version? There may be additional things on the Wasm side that could make the execution time faster. E.g., I noticed that loading the big weights files with
readBytes
seemed to take 20-25 seconds (aas-wasi
issue?).The text was updated successfully, but these errors were encountered: