perf[protocol]: prediction Length

This commit is contained in:
sun
2023-09-27 15:42:49 +08:00
parent e06bd091cf
commit d969856ca4
4 changed files with 4 additions and 4 deletions
@@ -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;
}
}