-
-
Notifications
You must be signed in to change notification settings - Fork 673
Optimize some std mem methods by replacing expensive rem operations to fast bit logic #24
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
Conversation
Seems like a good issue for Binaryen's optimizer as well. |
Yep, I thought about it as well |
And what you think if replace this: store<u32>(dest , load<u32>(src ));
store<u32>(dest + 4, load<u32>(src + 4));
store<u32>(dest + 8, load<u32>(src + 8));
store<u32>(dest + 12, load<u32>(src + 12));
src += 16; dest += 16; n -= 16;
src += 16; dest += 16; n -= 16; to: store<u64>(dest , load<u64>(src ));
store<u64>(dest + 8, load<u64>(src + 8));
src += 16; dest += 16; n -= 16;
src += 16; dest += 16; n -= 16; for aligned memory copy? |
Depends whether |
Seems not, as it starts with |
You are right. But for classes and arrays we can expecting 8 byte alignment when mem layout will be finish of course, right? So It's exactly for that case |
Well, imagine an Uint8Array. The class would be aligned to 4 bytes because it starts with an i32 length (unless WASM64 is the target, requireing a pointer to the array being aligned to 8 bytes). Its data, which is a separate block, would be aligned to 4 bytes just because that's the minimum alignment (otherwise it'd be 1). Don't worry too much about these. The |
Ok, I got it |
These changes are looking good to me. Please include yourself in the NOTICE file before I merge :) |
Done! Thanks;) |
Thanks :) |
Update to Wasm new read API
Bumps [assemblyscript](https://github.com/AssemblyScript/assemblyscript) from 0.9.1 to 0.9.2. - [Release notes](https://github.com/AssemblyScript/assemblyscript/releases) - [Commits](AssemblyScript/assemblyscript@v0.9.1...v0.9.2) Signed-off-by: dependabot-preview[bot] <[email protected]>
* 'master' of github.com:jedisct1/wasa: Fixed the memory leak for Time.sleep (AssemblyScript#33) Improve Descriptor (AssemblyScript#25) Bump assemblyscript from 0.9.2 to 0.9.4 (AssemblyScript#27) Deps Optimizations + update dependencies (AssemblyScript#21) Bump @as-pect/cli from 2.7.0 to 2.8.1 (AssemblyScript#23) Bump assemblyscript from 0.9.1 to 0.9.2 (AssemblyScript#24) Fix Date.now to return milliseconds instead of microseconds (AssemblyScript#19) Bump assemblyscript from 0.9.0 to 0.9.1 (AssemblyScript#17)
No description provided.