-
Notifications
You must be signed in to change notification settings - Fork 4
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
Implement Deserializer
for Pod
#5
Comments
Well, when I wrote this crate, I was expecting a scenario where the frontmatter of markdown is parsed out at compile time so that yew can generate static files, which is similar to what vuepress does. So I didn't care about performance, since it's a compile-time overhead. However, I have noticed that some people use it at runtime. So I general totally agree with you that a little bit of runtime performance optimization is needed. But as to whether discarding pod types to improve performance, some benchmark comparing this two way shall be done to make it more convincing. When the pod type was introduced into the crate, I hadn't considered serd_json so I didn't use value instead. |
Also, I think we should do optimization as soon as it is proven necessary. The fewer users, the less cost to make breaking changes. Just follow semantics well. |
Thinking more about it, perhaps we should keep The |
Yes, we should think about this a bit more carefully. Currently using serde_json to do serialization and deserialization is just for the sake of meet my need quickly, so I didn't bother with that part, it's a bit complicated after all. Since runtime performance is a concern, it's time to do this part ourselves |
Deserialize
for Pod
Deserializer
for Pod
While investigating #3, I realised that we don't really have a need for the polyglot datatype
Pod
. Since we nonetheless coerce it into aserde_json::Value
upon deserializing,Pod
can easily be replaced byValue
- essentially skipping a conversion step.This would increase performance (probably not by much, but every nanosecond counts) and drastically reduce code complexity.
Changing this would introduce an API change, so I don't see the rush to do it, but I'm leaving this issue here for whenever we deem it fit to implement.
The text was updated successfully, but these errors were encountered: