flink-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Gabor Gevay (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (FLINK-8117) Eliminate modulo operation from RoundRobinChannelSelector and RebalancePartitioner
Date Fri, 24 Nov 2017 12:57:00 GMT

     [ https://issues.apache.org/jira/browse/FLINK-8117?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Gabor Gevay resolved FLINK-8117.
--------------------------------
    Resolution: Implemented

> Eliminate modulo operation from RoundRobinChannelSelector and RebalancePartitioner
> ----------------------------------------------------------------------------------
>
>                 Key: FLINK-8117
>                 URL: https://issues.apache.org/jira/browse/FLINK-8117
>             Project: Flink
>          Issue Type: Improvement
>          Components: Local Runtime, Streaming
>            Reporter: Gabor Gevay
>            Assignee: Gabor Gevay
>            Priority: Minor
>              Labels: performance
>             Fix For: 1.5.0
>
>
> {{RoundRobinChannelSelector}}, {{RebalancePartitioner}}, and {{RescalePartitioner}} use
a modulo operation to wrap around when the current channel counter reaches the number of channels.
Using an {{if}} would have better performance.
> A division with 32 bit operands is ~25 cycles on modern Intel CPUs \[1\], but the {{if}}
will be only 1-2 cycles on average, since the branch predictor can most of the time predict
the condition to be false.
> \[1\] http://www.agner.org/optimize/instruction_tables.pdf



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

Mime
View raw message