Cysharp / MemoryPack

Zero encoding extreme performance binary serializer for C# and Unity.
MIT License
3.29k stars 193 forks source link

Support types that aren't known at compile time #236

Closed burnchar closed 7 months ago

burnchar commented 7 months ago

What are the chances that MemoryPack can support dynamic types? For example, we use applications that allow the user to request only the necessary columns from a database or other source, so the columns are not known until the query executes.

Dapper does an excellent job of putting this into a Dynamic, which can then be serialized to JSON or CSV or other formats (We do not use the Dynamic directly).

For mixed applications which use both concrete objects and dynamic ones, we can't consistently support MemoryPack. Can MemoryPack handle dynamic objects, even if it comes at a performance cost?

neuecc commented 7 months ago

No. Because it is based on Source Generator, it cannot dynamically generate types. Does not support completely type-less serialization/deserialization.

burnchar commented 7 months ago

Thank you for educating me.