Integrated: 8314120: Add tests for FileDescriptor.sync
Aleksey Shipilev
shade at openjdk.org
Tue Aug 15 16:14:28 UTC 2023
On Thu, 10 Aug 2023 15:45:12 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:
> When backporting [JDK-8312127](https://bugs.openjdk.org/browse/JDK-8312127), I realized there are no targeted tests for `FileDescriptor.sync` that can be used to qualify the changes in that area.
>
> Additionally, we use `FD.sync` for durability in Java databases, and we want to make sure at least some smoke tests are available in OpenJDK. Asserting durability would be hard, but let's at least test the Java code does not throw unexpected exceptions and native code does not crash the VM.
>
> The benchmark will show, among other things, that the recent change to `FileDescriptor.sync` does not affect the performance much, compared to the cost of the `fsync` itself. It deliberately targets tmpfs to provide the lowest actual FS overhead.
>
>
> Benchmark Mode Cnt Score Error Units
>
> # Before JDK-8312127
> FileDescriptorSync.sync avgt 15 351,688 ? 2,477 ns/op
>
> # After JDK-8312127
> FileDescriptorSync.sync avgt 15 353,331 ? 2,116 ns/op
>
>
> The new regression test completes in <0.5s on my Mac.
This pull request has now been integrated.
Changeset: 2e8a0ab2
Author: Aleksey Shipilev <shade at openjdk.org>
URL: https://git.openjdk.org/jdk/commit/2e8a0ab27227b2e06e2ece3776f66ff0932ef353
Stats: 165 lines in 2 files changed: 165 ins; 0 del; 0 mod
8314120: Add tests for FileDescriptor.sync
Reviewed-by: alanb, bpb
-------------
PR: https://git.openjdk.org/jdk/pull/15231
More information about the core-libs-dev
mailing list