You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am not wanting to go down the path of optimizing libc calls. Some things don't even have libc (e.g. Go) and functions like memcpy are not guaranteed to come over the same every time. There are plenty of other WASM situations where bulk memory operations can be improved, not just memcpy. At this point, of that's really important, I'd recommend a post processor use ASM and change the source. Or if there is a good spot for me to make the current code more extensible so a caller can do this with some kind of separate "contrib" project, I will be happy to add those extension hooks.
I really want to only support WASM without library-specific pattern catching/optimization. I'm afraid this will instead have to wait for https://github.com/WebAssembly/bulk-memory-operations and then clang to call it.
EDIT: After more thought, I might be open to pattern matching a bulk get/put set of ops, not memcpy specific or at the whole function level, but if it is generic enough we might be able to do it. But I would rather wait for bulk mem ops.
If my program uses
memcpy
, in java (byte)code I see this implementation:But it can be implemented in much more efficient way by using ByteBuffer API:
With this implementation the real native
memcpy
will be used (ifmemory
isDirectByteBuffer
).We can detect functions like
memcpy
by their names, signatures and bodies, and then replace them with more efficient implementation.The text was updated successfully, but these errors were encountered: