You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tsfile.apache.org by ColinLee <sh...@163.com> on 2026/08/13 02:43:03 UTC

[Proposal] Introduce an mmap read backend for the C++ TsFile Reader

Hi all,

I would like to propose adding an mmap-based local file read backend to the C++ TsFile Reader.

Currently, the C++ Reader accesses local files through ReadFile, which uses pread on POSIX platforms. This read path is also shared by the C API and Python Reader.

The proposal is to retain the existing pread implementation while adding mmap as an optional backend. This may reduce system-call overhead for fine-grained random reads and provide a foundation for directly accessing mapped regions in future optimizations. On POSIX systems, the original file descriptor can also be closed after a successful mapping, which may reduce long-lived FD usage when reading many TsFiles concurrently.

I have created an Issue describing the proposed interface and mechanism:

https://github.com/apache/tsfile/issues/903

Comments and suggestions are welcome.

Best regards,
Colin Lee