scwhittle commented on code in PR #37964:
URL: https://github.com/apache/beam/pull/37964#discussion_r3087216323
##########
sdks/java/harness/src/main/java/org/apache/beam/fn/harness/state/StateFetchingIterators.java:
##########
@@ -299,29 +356,47 @@ public static <T> Block<T> mutatedBlock(WeightedList<T>
values) {
}
public static <T> Block<T> fromValues(List<T> values, @Nullable
ByteString nextToken) {
- return fromValues(WeightedList.of(values, Caches.weigh(values)),
nextToken);
+ long listWeight = values.size() * Caches.REFERENCE_SIZE;
Review Comment:
It seems a little safer just here since we know the lists. A possible
concern with it in Caches.weigh is that it could remove counting of bytes for
custom lists/collections which are more expensive than when iterated.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]