wasm-astar
wasm-astar copied to clipboard
Is there a better or faster way to send text from Rust to js?
Another solution is to store a dictionary map on the js side and just send ids back and forth. That's better for static text, but dynamic text would still need to be sent across and decoded.
FWIW I don't believe there's any way to avoid the copying overhead right now. That being said, though, I'm sure there's some construction of JS which is the fastest way to copy data (least bound checks, etc), but I haven't benchmarked to see what's best yet :)
Overall I wouldn't worry too much in general, and once it starts showing up in a profile I believe the solution for now is "figure out how to copy less often" rather than "figure out how to copy faster"