Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.5.5, 2.1.0
-
None
-
None
Description
Speedup reads trying to exploit the OS Page Cache (eg LMDB does something similar) while reading a Page.
It is accomplished using READ-ONLY mapped regions on the written Page instead of using a single SequentialFile::read with a big ( === file size) direct ByteBuffer.
The benefits are:
- avoid allocating the direct ByteBuffer (no OOM errors while reading tons of pages)
- avoid the additional copy from the Page Cache to the direct ByteBuffer
- makes uses of the last written (OS) pages directly, improving the read speed
- avoid a slow JNI call (avoid long time to safepoint issues)
This can work only with SequentialFile implementations that rely on the OS Page Cache (only MAPPED and NIO right now).
Depending on the file size and the OS the read speedup can be until 6X of the original version.
The memory footprint is improved in way dependent by OS settings (how many dirty pages allowed, OS Pages size etc etc), but anyway out of the JVM boundaries.
Attachments
Issue Links
- links to