You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Gabor Gevay (JIRA)" <ji...@apache.org> on 2017/11/24 12:57:00 UTC
[jira] [Resolved] (FLINK-8117) Eliminate modulo operation from
RoundRobinChannelSelector and RebalancePartitioner
[ 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)