Skip to content

HDDS-16098. Speed up TestStreamRead - #10961

Open
adoroszlai wants to merge 1 commit into
apache:masterfrom
adoroszlai:HDDS-16098
Open

HDDS-16098. Speed up TestStreamRead#10961
adoroszlai wants to merge 1 commit into
apache:masterfrom
adoroszlai:HDDS-16098

Conversation

@adoroszlai

Copy link
Copy Markdown
Contributor

What changes were proposed in this pull request?

Speed up TestStreamRead: bytes per checksum setting only affects client, the test cases can share the cluster.

https://issues.apache.org/jira/browse/HDDS-16098

How was this patch tested?

Before (local):

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 161.2 s -- in org.apache.hadoop.ozone.client.rpc.read.TestStreamRead
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey16k -- Time elapsed: 56.12 s
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey512 -- Time elapsed: 63.72 s
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey256k -- Time elapsed: 41.28 s

After (local):

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 109.2 s -- in org.apache.hadoop.ozone.client.rpc.read.TestStreamRead
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey16k -- Time elapsed: 39.27 s
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey512 -- Time elapsed: 36.29 s
[INFO] org.apache.hadoop.ozone.client.rpc.read.TestStreamRead.testReadKey256k -- Time elapsed: 15.83 s

Before (CI):

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 184.0 s -- in org.apache.hadoop.ozone.client.rpc.read.TestStreamRead

After (CI):

[INFO] Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 130.6 s -- in org.apache.hadoop.ozone.client.rpc.read.TestStreamRead

@adoroszlai adoroszlai added the test label Aug 6, 2026
@adoroszlai adoroszlai self-assigned this Aug 6, 2026
final File blockFile = ContainerLayoutVersion.FILE_PER_BLOCK.getChunkFile(containerData, blockId, null);
assertTrue(blockFile.exists());
assertEquals(BLOCK_SIZE, blockFile.length());
final String expectedMd5 = generateMd5(keySize, SizeInBytes.ONE_MB, blockFile);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

md5 is slow, we can use CRC32 for a checksum it should improve test performance even further

@adoroszlai adoroszlai Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I get the following error:

NoSuchAlgorithmException: CRC32 MessageDigest not available

I also tried SHA-256, but it's even slower.

BTW, this is out of scope here. MD5 is used many places, so if there is room for improvement, it should be applied globally.

@yandrey321 yandrey321 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@rich7420 rich7420 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the patch @adoroszlai !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants