malcolmstill / zware

Zig WebAssembly Runtime Engine
MIT License
293 stars 10 forks source link

Fast memory.fill and memory.copy #193

Closed malcolmstill closed 1 year ago

malcolmstill commented 1 year ago

Description

The previous implementations of memory.fill and memory.copy were correct in a semantic sense but not in a performant sense (the reason for their introduction into the WebAssembly spec).

This removes individual byte writes (with a check on each byte written...i.e. slow) with trusting the bounds check in the virtual instruction handler.

Follow ups