wasm-astar icon indicating copy to clipboard operation
wasm-astar copied to clipboard

Is there a better or faster way to send text from Rust to js?

Open jacobdeichert opened this issue 7 years ago • 1 comments

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.

jacobdeichert avatar Dec 29 '17 01:12 jacobdeichert

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"

alexcrichton avatar Dec 31 '17 06:12 alexcrichton