You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
CborSerializerGenerator serializes structure shapes using indefinite-length CBOR maps. However, when all the member shapes are non-Optional, we know ahead of time the fixed length, and we could use a definite-length encoding for added efficiency.
The only implementation difficulty here is that we serialize an added field, __type, as a customization, in AddTypeFieldToServerErrorsCborCustomization.kt, when serializing error responses in the server, so depending on whether the customization was added or not, we need to encode an extra field. A possibility could be to simply gate the __type-encoding behavior behind a constructor flag in CborSerializerGenerator as opposed to using a customization.
It'd be interesting to tackle this after we have proper benchmarks (#214) to determine any performance impact.
The text was updated successfully, but these errors were encountered:
CborSerializerGenerator
serializesstructure
shapes using indefinite-length CBOR maps. However, when all the member shapes are non-Option
al, we know ahead of time the fixed length, and we could use a definite-length encoding for added efficiency.The only implementation difficulty here is that we serialize an added field,
__type
, as a customization, inAddTypeFieldToServerErrorsCborCustomization.kt
, when serializing error responses in the server, so depending on whether the customization was added or not, we need to encode an extra field. A possibility could be to simply gate the__type
-encoding behavior behind a constructor flag inCborSerializerGenerator
as opposed to using a customization.It'd be interesting to tackle this after we have proper benchmarks (#214) to determine any performance impact.
The text was updated successfully, but these errors were encountered: