GitHub user HuangWHWHW opened a pull request:
https://github.com/apache/flink/pull/1029
[FLINK-2534][RUNTIME]Improve in CompactingHashTable.java
1. Remove the var currentForwardPointer is unused in the code since this
can reduce little memory cost.
2.Take the numInSegment++ out of the if branch and remove the else branch
to decrease the loop complexity.
3.Improve the "while" to a formula:
numBuckets += numPartitions - numBuckets % numPartitions;
Otherwise, I found some places just simply using "for" to find a max or min
number like the code following:
'private int getMaxPartition() {
int maxPartition = 0;
for(InMemoryPartition<T> p1 : this.partitions) {
if(p1.getBlockCount() > maxPartition) {
maxPartition = p1.getBlockCount();
}
}
return maxPartition;
}'
This does some harm to the performance.
Should we use some algorithm(.i.e RMQ, Segment tree, Heap structure) to
take a optimization?
You can merge this pull request into a Git repository by running:
$ git pull https://github.com/HuangWHWHW/flink FLINK-2534
Alternatively you can review and apply these changes as the patch at:
https://github.com/apache/flink/pull/1029.patch
To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:
This closes #1029
----
commit 4303d6541cd539715d64780b1c4dc2b883ead99e
Author: HuangWHWHW <[email protected]>
Date: 2015-08-17T03:31:02Z
[FLINK-2534][RUNTIME]Improve in CompactingHashTable.java
----
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---