mirror of
https://github.com/tiennm99/zfoo.git
synced 2026-10-12 20:16:07 +00:00
perf[protocol]: prediction Length
This commit is contained in:
1 parent
e06bd091cf
commit
d969856ca4
4 files changed
+4
-4
No files matched your search
@@ -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