You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@celeborn.apache.org by "waitinfuture (via GitHub)" <gi...@apache.org> on 2023/06/08 14:28:08 UTC

[GitHub] [incubator-celeborn] waitinfuture commented on a diff in pull request #1560: [CELEBORN-648][SPARK] Improve perf SendBufferPool and logs about memory

waitinfuture commented on code in PR #1560:
URL: https://github.com/apache/incubator-celeborn/pull/1560#discussion_r1223126561


##########
client-spark/common/src/main/java/org/apache/spark/shuffle/celeborn/SendBufferPool.java:
##########
@@ -36,23 +37,27 @@ public static SendBufferPool get(int capacity) {
   private final int capacity;
 
   // numPartitions -> buffers
-  private LinkedList<byte[][]> buffers;
+  private final LinkedList<byte[][]> buffers;
 
-  public SendBufferPool(int capacity) {
+  private SendBufferPool(int capacity) {
+    assert capacity > 0;
     this.capacity = capacity;
     buffers = new LinkedList<>();
   }
 
   public synchronized byte[][] acquireBuffer(int numPartitions) {
-    for (int i = 0; i < buffers.size(); i++) {
-      if (buffers.get(i).length == numPartitions) {
-        return buffers.remove(i);
+    Iterator<byte[][]> iterator = buffers.iterator();

Review Comment:
   I see, thanks.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@celeborn.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org