[
https://issues.apache.org/jira/browse/FLINK-10325?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16615148#comment-16615148
]
ASF GitHub Bot commented on FLINK-10325:
----------------------------------------
tillrohrmann commented on a change in pull request #6683: [FLINK-10325] [State
TTL] Refactor TtlListState to use only loops, no java stream API for performance
URL: https://github.com/apache/flink/pull/6683#discussion_r217782974
##########
File path:
flink-runtime/src/main/java/org/apache/flink/runtime/state/ttl/TtlListState.java
##########
@@ -73,11 +72,14 @@ public void addAll(List<T> values) throws Exception {
return () -> new IteratorWithCleanup(finalResult.iterator());
}
- private void updateTs(List<TtlValue<T>> ttlValue) throws Exception {
- List<TtlValue<T>> unexpiredWithUpdatedTs = ttlValue.stream()
- .filter(v -> !expired(v))
- .map(this::rewrapWithNewTs)
- .collect(Collectors.toList());
+ private void updateTs(List<TtlValue<T>> ttlValues) throws Exception {
+ List<TtlValue<T>> unexpiredWithUpdatedTs = new ArrayList<>();
Review comment:
Would it make sense to initialize the capacity of this `ArrayList` to
`ttlValues.size`? That way we would save resizing work.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> [State TTL] Refactor TtlListState to use only loops, no java stream API for
> performance
> ---------------------------------------------------------------------------------------
>
> Key: FLINK-10325
> URL: https://issues.apache.org/jira/browse/FLINK-10325
> Project: Flink
> Issue Type: Improvement
> Components: State Backends, Checkpointing
> Affects Versions: 1.6.0
> Reporter: Andrey Zagrebin
> Assignee: Andrey Zagrebin
> Priority: Major
> Labels: pull-request-available
> Fix For: 1.6.1, 1.7.0
>
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)