Skip to content

More efficient serialization of struct #65

@evmar

Description

@evmar

Thanks for making this crate!

I looked into its implementation a bit and have a possible improvement that I discuss here:
https://neugierig.org/software/blog/2024/04/rust-wasm-to-js.html

The tldr is you can avoid the static_str_to_js cache by instead codegenning a JS function per struct that you serialize, which would likely also better this JS VM object construction caches. Some sample code from my prototype sketch. I'm not certain it's possible within the serde architecture -- serde is still a bit overwhelming to me -- but I think maybe it's a small tweak on ObjectSerializer?

In any case, I figured since you were interested in the performance of this area you might be interested in this. Feel free to close this bug if it doesn't suit you, I just figured this was the place to bring it to your attention.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions