Or simply use the canvas api, which has super optimized graphics libraries behind it - rather than reimplementing the wheel :)
But I get that really this was a how much can wasm help performance as % vs js - you could always write an “optimized” routine and compare those and theoretically achieve something similar.