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
If we push Integer type to ListSerializer and String, List<Long> to MapSerializer, then ListSerializer will know every element is an Integer, there will be no need to query element serializer and write element type every time serializing those elements, thus much space/time efficient.
MapSerializer can use same mechanism. Also when serializing List<Long> value, MapSerializer can push Long to ListSerializer, which make nested list serialization more efficient too.
Java generics is erasured at runtime,List type won't have element type. We need a way to push and propagate those erasured generics along the serialization.
Describe the solution you'd like
Using guava TypeToken to extract generics
Create an Generics to record generics hierarchy and current generics
Create an GenericType to tracking children generics and binding serializer to reduce map loopup cost
Is your feature request related to a problem? Please describe.
For class with nested generics such as:
If we push
Integer
type toListSerializer
andString, List<Long>
toMapSerializer
, thenListSerializer
will know every element is anInteger
, there will be no need to query element serializer and write element type every time serializing those elements, thus much space/time efficient.MapSerializer
can use same mechanism. Also when serializingList<Long>
value,MapSerializer
can pushLong
toListSerializer
, which make nested list serialization more efficient too.Java generics is erasured at runtime,
List
type won't have element type. We need a way to push and propagate those erasured generics along the serialization.Describe the solution you'd like
TypeToken
to extract genericsGenerics
to record generics hierarchy and current genericsGenericType
to tracking children generics and binding serializer to reduce map loopup costAdditional context
#70
The text was updated successfully, but these errors were encountered: