[
https://issues.apache.org/jira/browse/FLINK-10537?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16653494#comment-16653494
]
ASF GitHub Bot commented on FLINK-10537:
----------------------------------------
pnowojski closed pull request #6833: [FLINK-10537][network] Fix network small
performance degradation after merging [FLINK-9913]
URL: https://github.com/apache/flink/pull/6833
This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:
As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):
diff --git
a/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java
b/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java
index 7738a3091e1..01feae03380 100644
---
a/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java
+++
b/flink-core/src/main/java/org/apache/flink/core/memory/DataOutputSerializer.java
@@ -108,6 +108,7 @@ public int length() {
}
public void pruneBuffer() {
+ clear();
if (this.buffer.length > PRUNE_BUFFER_THRESHOLD) {
if (LOG.isDebugEnabled()) {
LOG.debug("Releasing serialization buffer of "
+ this.buffer.length + " bytes.");
diff --git
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/RecordSerializer.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/RecordSerializer.java
index 6eebbbe88eb..c0cf35d9576 100644
---
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/RecordSerializer.java
+++
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/RecordSerializer.java
@@ -82,9 +82,9 @@ public boolean isFullBuffer() {
SerializationResult copyToBufferBuilder(BufferBuilder bufferBuilder);
/**
- * Checks to decrease the size of intermediate data serialization
buffer after finishing the
- * whole serialization process including {@link
#serializeRecord(IOReadableWritable)} and
- * {@link #copyToBufferBuilder(BufferBuilder)}.
+ * Clears the buffer and checks to decrease the size of intermediate
data serialization buffer
+ * after finishing the whole serialization process including
+ * {@link #serializeRecord(IOReadableWritable)} and {@link
#copyToBufferBuilder(BufferBuilder)}.
*/
void prune();
diff --git
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
index ba2ed0133fd..f0666791ec2 100644
---
a/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
+++
b/flink-runtime/src/main/java/org/apache/flink/runtime/io/network/api/serialization/SpanningRecordSerializer.java
@@ -92,20 +92,9 @@ public void serializeRecord(T record) throws IOException {
*/
@Override
public SerializationResult copyToBufferBuilder(BufferBuilder
targetBuffer) {
- boolean mustCommit = false;
- if (lengthBuffer.hasRemaining()) {
- targetBuffer.append(lengthBuffer);
- mustCommit = true;
- }
-
- if (dataBuffer.hasRemaining()) {
- targetBuffer.append(dataBuffer);
- mustCommit = true;
- }
-
- if (mustCommit) {
- targetBuffer.commit();
- }
+ targetBuffer.append(lengthBuffer);
+ targetBuffer.append(dataBuffer);
+ targetBuffer.commit();
return getSerializationResult(targetBuffer);
}
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
> Network throughput performance regression after broadcast changes
> -----------------------------------------------------------------
>
> Key: FLINK-10537
> URL: https://issues.apache.org/jira/browse/FLINK-10537
> Project: Flink
> Issue Type: Bug
> Components: Network
> Affects Versions: 1.7.0
> Reporter: Piotr Nowojski
> Assignee: Piotr Nowojski
> Priority: Major
> Labels: pull-request-available
>
> There is a slight network throughput regression introduced in:
> https://issues.apache.org/jira/browse/FLINK-9913
> It is visible in the following benchmark:
> [http://codespeed.dak8s.net:8000/timeline/#/?exe=1&ben=networkThroughput.1,100ms&env=2&revs=200&equid=off&quarts=on&extr=on]
> (drop in the chart that happened since 21st September.)
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)