Skip to content

Commit

Permalink
perf[protocol]: prediction Length
Browse files Browse the repository at this point in the history
  • Loading branch information
jaysunxiao committed Sep 27, 2023
1 parent e06bd09 commit d969856
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public Object defaultValue(IFieldRegistration fieldRegistration) {
public int predictionLength(IFieldRegistration fieldRegistration) {
ArrayField arrayField = (ArrayField) fieldRegistration;
var length = arrayField.getArrayElementRegistration().serializer().predictionLength(arrayField.getArrayElementRegistration());
return 9 * length;
return 7 * length;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ public Object defaultValue(IFieldRegistration fieldRegistration) {
public int predictionLength(IFieldRegistration fieldRegistration) {
ListField listField = (ListField) fieldRegistration;
var length = listField.getListElementRegistration().serializer().predictionLength(listField.getListElementRegistration());
return 9 * length;
return 7 * length;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,6 @@ public int predictionLength(IFieldRegistration fieldRegistration) {
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);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public Object defaultValue(IFieldRegistration fieldRegistration) {
public int predictionLength(IFieldRegistration fieldRegistration) {
var setField = (SetField) fieldRegistration;
var length = setField.getSetElementRegistration().serializer().predictionLength(setField.getSetElementRegistration());
return 9 * length;
return 7 * length;
}

}

0 comments on commit d969856

Please sign in to comment.