flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (FLINK-6589) ListSerializer should deserialize as ArrayList with size + 1
Date Wed, 17 May 2017 09:03:04 GMT

    [ https://issues.apache.org/jira/browse/FLINK-6589?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16013760#comment-16013760

ASF GitHub Bot commented on FLINK-6589:

Github user StefanRRichter commented on the issue:

    Yes, there is a tradeoff, and probably the nicest way would be to restore the internal
array size as it was when we serialized the original. However, I guess that is too much effort
for the effect. Since the sweetspot also depends on the access pattern, I think everything
from +1 to some percentage could be justified and as there is no clear "best strategy" I would
leave this up to your judgment call.
    +1 from me then.

> ListSerializer should deserialize as ArrayList with size + 1
> ------------------------------------------------------------
>                 Key: FLINK-6589
>                 URL: https://issues.apache.org/jira/browse/FLINK-6589
>             Project: Flink
>          Issue Type: Improvement
>          Components: Core
>    Affects Versions: 1.3.0, 1.4.0
>            Reporter: Fabian Hueske
>            Assignee: Fabian Hueske
> The {{ListSerializer}} deserializes a list as {{ArrayList}} with exactly the required
capacity, i.e., number of serialized objects.
> Several operators in the Table API have a {{MapState<Long, List<X>>}} to
store received elements in a list per timestamp. Hence, retrieving the list and adding one
element to the list is a very common operation.
> Since the list which is deserialized has no room left for adding elements, the first
insertion into the list will result in growing the {{ArrayList}} which is expensive.
> I propose to initialize the {{ArrayList}} returned by the {{ListSerializer}} with numberOfSerializedElements
+ 1. This will only marginally increase the size of the list and allow for one insertion without
growing the list.

This message was sent by Atlassian JIRA

View raw message