Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

write throughput very low compared to read #125

Open
lynus opened this issue May 26, 2021 · 1 comment
Open

write throughput very low compared to read #125

lynus opened this issue May 26, 2021 · 1 comment

Comments

@lynus
Copy link

lynus commented May 26, 2021

I found write perform very poorly compared to read.
I modified MemoryFS such that MemoryFile' read() and write() basically do nothing:
`
private int read(Pointer buffer, long size, long offset) {
int bytesToRead = (int) Math.min(filesize - offset, size);
return bytesToRead;
}

private int write(Pointer buffer, long bufSize, long writeOffset) {
int maxWriteIndex = (int) (writeOffset + bufSize);
if (maxWriteIndex > filesize)
filesize = maxWriteIndex;
return (int) bufSize;
}
`
The benchmark workload executed is simply sequently write and then read a single file. The throughput for read/write are
2000MB/s and 300MB/s. I tried various block sizes and the gap persists.

@lynus
Copy link
Author

lynus commented May 28, 2021

I tested the same read/write stub routine on juse-jna, the result shows their throughput are nearly the equal.
I compile the code with openjdk8. And the jvm the code run on are openjdk8 and openjdk16, the big gap exists on both platforms.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant