You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@uniffle.apache.org by ro...@apache.org on 2022/07/28 02:51:18 UTC

[incubator-uniffle] branch master updated: [Performance Optimization] Improve the speed of writing index file in shuffle server (#91)

This is an automated email from the ASF dual-hosted git repository.

roryqi pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-uniffle.git


The following commit(s) were added to refs/heads/master by this push:
     new cdbacca  [Performance Optimization] Improve the speed of writing index file in shuffle server (#91)
cdbacca is described below

commit cdbacca19736fd1eccc8ab65c085ec4455d74c71
Author: Junfan Zhang <ju...@outlook.com>
AuthorDate: Thu Jul 28 10:51:14 2022 +0800

    [Performance Optimization] Improve the speed of writing index file in shuffle server (#91)
    
    ### What changes were proposed in this pull request?
    solve issue #90 [Performance Optimization] Improve the speed of writing index file in shuffle server
    
    ### Why are the changes needed?
    When I test uniffle performance, i found a huge performance drop due to the low speed of writing index file.
    
    After using "dataOutputStream = new DataOutputStream(new BufferedOutputStream(fileOutputStream))" in LocalFileWriter, the performance has great imrpovement.
    
    ### Does this PR introduce _any_ user-facing change?
    No
    
    ### How was this patch tested?
    by FlameGraph
---
 .../java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java  | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java b/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java
index 7868e14..8c3e99e 100644
--- a/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java
+++ b/storage/src/main/java/org/apache/uniffle/storage/handler/impl/LocalFileWriter.java
@@ -17,6 +17,7 @@
 
 package org.apache.uniffle.storage.handler.impl;
 
+import java.io.BufferedOutputStream;
 import java.io.Closeable;
 import java.io.DataOutputStream;
 import java.io.File;
@@ -34,7 +35,7 @@ public class LocalFileWriter implements Closeable {
   public LocalFileWriter(File file) throws IOException {
     fileOutputStream = new FileOutputStream(file, true);
     // init fsDataOutputStream
-    dataOutputStream = new DataOutputStream(fileOutputStream);
+    dataOutputStream = new DataOutputStream(new BufferedOutputStream(fileOutputStream));
     nextOffset = file.length();
   }