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

ASF GitHub Bot commented on FLINK-8227:
---------------------------------------

Github user dianfu commented on the issue:

    https://github.com/apache/flink/pull/5142
  
    The page number is the number of patterns and so it is usually very small.  
The `long` is only needed in theory just as you said MAX_INT * MAX_INT 
resulting to MAX_LONG. If this makes sense, then the `HashMap` may be should 
also be replaced as the entry number in one page may be MAX_LONG in theory too. 
 
    
    Changing `int` to `long` will introduce state incompatible issue and we 
need to take care of that when performing serialization/deserialization. I just 
wonder if it is worth making this change.


> Optimize the performance of SharedBufferSerializer
> --------------------------------------------------
>
>                 Key: FLINK-8227
>                 URL: https://issues.apache.org/jira/browse/FLINK-8227
>             Project: Flink
>          Issue Type: Bug
>          Components: CEP
>            Reporter: Dian Fu
>            Assignee: Dian Fu
>
> Currently {{SharedBufferSerializer.serialize()}} will create a HashMap and 
> put all the {{SharedBufferEntry}} into it. Usually this is not a problem. But 
> we obverse that in some cases the calculation of hashCode may become the 
> bottleneck. The performance will decrease as the number of 
> {{SharedBufferEdge}} increases. For looping pattern {{A*}}, if the number of 
> {{SharedBufferEntry}} is {{N}}, the number of {{SharedBufferEdge}} is about 
> {{N * N}}.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to