-
-
Notifications
You must be signed in to change notification settings - Fork 774
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
Efficient serialization of programmatically constructed strings #746
Comments
The best design would be an associated type with a default value, implementing the associated trait as a |
I would like to have benchmarks before making a decision on this. Sometimes things that are obvious optimizations turn out to be negligible or even detrimental. In this case conceivably we could be taking something that is a tight loop over here and a tight loop over there and turning it into code that jumps back and forth between two loops in a way that makes the CPU sad. @nox could you come up with a benchmark to show that this is X% better than the existing approach in some reasonable use case? |
I'm not sure I understand how it could get slower? Which tight loops? |
#778 convinced me that there is plenty of performance to be gained here. |
@dtolnay I think so. |
Personally, I think that it'd be nice if we could expose the implementations from #778 somehow so that any crate can use it. |
This can be closed now, right? |
A neat idea from @nox that would make a big difference for hyper_serde. We shouldn't need to build the entire string in memory before serializing it.
The text was updated successfully, but these errors were encountered: