mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-08-20 08:24:16 +00:00
perf[protocol]: prediction Length
This commit is contained in:
@@ -78,7 +78,7 @@ public class ArraySerializer implements ISerializer {
|
||||
public int predictionLength(IFieldRegistration fieldRegistration) {
|
||||
ArrayField arrayField = (ArrayField) fieldRegistration;
|
||||
var length = arrayField.getArrayElementRegistration().serializer().predictionLength(arrayField.getArrayElementRegistration());
|
||||
return 9 * length;
|
||||
return 7 * length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -73,6 +73,6 @@ public class ListSerializer implements ISerializer {
|
||||
public int predictionLength(IFieldRegistration fieldRegistration) {
|
||||
ListField listField = (ListField) fieldRegistration;
|
||||
var length = listField.getListElementRegistration().serializer().predictionLength(listField.getListElementRegistration());
|
||||
return 9 * length;
|
||||
return 7 * length;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -81,6 +81,6 @@ public class MapSerializer implements ISerializer {
|
||||
var mapField = (MapField) fieldRegistration;
|
||||
var keyLength = mapField.getMapKeyRegistration().serializer().predictionLength(mapField.getMapKeyRegistration());
|
||||
var valueLength = mapField.getMapValueRegistration().serializer().predictionLength(mapField.getMapValueRegistration());
|
||||
return 9 * (keyLength + valueLength);
|
||||
return 7 * (keyLength + valueLength);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -75,7 +75,7 @@ public class SetSerializer implements ISerializer {
|
||||
public int predictionLength(IFieldRegistration fieldRegistration) {
|
||||
var setField = (SetField) fieldRegistration;
|
||||
var length = setField.getSetElementRegistration().serializer().predictionLength(setField.getSetElementRegistration());
|
||||
return 9 * length;
|
||||
return 7 * length;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user