Skip to content
Commit a4121e96 authored by Vito Caputo's avatar Vito Caputo Committed by Lennart Poettering
Browse files

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.
parent fad45198
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment