Skip to content
This repository was archived by the owner on Dec 3, 2023. It is now read-only.

Commit 7303d92

Browse files
author
Dom Zippilli
committed
feat: Increase DEFAULT_CHUNK_SIZE to reduce transfer overhead
1 parent d8af07a commit 7303d92

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

google-cloud-core/src/main/java/com/google/cloud/BaseWriteChannel.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ public abstract class BaseWriteChannel<
3636
ServiceOptionsT extends ServiceOptions<?, ServiceOptionsT>, EntityT extends Serializable>
3737
implements WriteChannel {
3838

39-
private static final int MIN_CHUNK_SIZE = 256 * 1024;
40-
private static final int DEFAULT_CHUNK_SIZE = 8 * MIN_CHUNK_SIZE;
39+
private static final int MIN_CHUNK_SIZE = 256 * 1024; // 256 KiB
40+
private static final int DEFAULT_CHUNK_SIZE = 60 * MIN_CHUNK_SIZE; // 15MiB
4141

4242
private final ServiceOptionsT options;
4343
private final EntityT entity;

google-cloud-core/src/test/java/com/google/cloud/BaseWriteChannelTest.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ protected CustomServiceOptions(
5555
private static final Serializable ENTITY = 42L;
5656
private static final String UPLOAD_ID = "uploadId";
5757
private static final byte[] CONTENT = {0xD, 0xE, 0xA, 0xD};
58-
private static final int MIN_CHUNK_SIZE = 256 * 1024;
59-
private static final int DEFAULT_CHUNK_SIZE = 8 * MIN_CHUNK_SIZE;
58+
private static final int MIN_CHUNK_SIZE = 256 * 1024; // 256 KiB
59+
private static final int DEFAULT_CHUNK_SIZE = 60 * MIN_CHUNK_SIZE; // 15MiB
6060
private static final Random RANDOM = new Random();
6161
private static BaseWriteChannel channel;
6262

0 commit comments

Comments
 (0)