Navigation Menu

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
jacobdeichert opened this issue Dec 29, 2017 · 1 comment
Open
Labels

Comments

@jacobdeichert
Copy link
Owner

jacobdeichert commented Dec 29, 2017

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.

@alexcrichton
Copy link

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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants