sd-journal: use FILE streams to buffer write_uint64()
journal_file_verify() uses a set of tmpfs files to create lists of object positions by type. The existing code used a bare write() call for every object position written, incurring a syscall per listed object. This commit encapsulates the bare file descriptors in FILE *'s and replaces the bare write with fwrite, buffering the writes so there's less syscalls. Cached `journalctl --verify` tests showed a ~8% faster runtime with this change on a release build, verifying 1.3GiB of production journals across 16 files.
Loading
Please register or sign in to comment