v1.1.1 — Performance & Throughput Improvements
v1.1.1 — Performance & Throughput Improvements**
Overview
Building on the expanded format support of v1.1.0, this release focuses on boosting speed, reducing latency, and enhancing scalability through multiple performance optimizations.
What’s New in This Release
-
Configurable Read Buffer (
-r/--read-buffer)
Allows tuning of the read buffer size (previously fixed at 1 MiB), enabling optimized I/O for different environments — especially useful for high-latency or low-bandwidth setups.
([GitHub][1]) -
Larger zlib Internal Buffer
Increased internal buffer size for.gz/.bgzdecompression to reduce the number of syscalls and improve throughput. -
Disable Sync Between
iostreamandstdio
Performance boost for output operations by turning off unnecessary synchronization when usingstd::cout. -
Batched Output Writing
Now grouping lines into a single write call instead of line-by-line printing significantly reduces overhead. -
True Ring Buffer Implementation
The previousCharRingBuffer(which shifted data on each erase) has been replaced with a proper circular buffer, eliminating O(n) overhead and improving memory handling. -
Double Buffering with Threads
Enables parallel decompression and parsing: while one buffer is being read, another is being processed, greatly reducing latency and increasing overall throughput.
Why It Matters
- Faster tail operations on large or remote files — especially critical with slow I/O (e.g., network shares or cloud storage).
- Lower CPU and syscalls overhead → plots smaller, faster, and more resource-efficient processes.
- Adaptable to various use cases — users can fine-tune buffer sizes to match machines with different memory and I/O profiles.
- Smoother CLI experience — fewer delays, more reliable performance under load.
Usage Example
# Tail 20 lines of a large compressed file with a custom read buffer (e.g., 4 MiB):
./ztail -n 20 -r 4194304 hugefile.zstReiteration of Formats & Usability from v1.1.0
- Supports
.gz,.bgz,.bz2,.xz,.zip, and.zst - Automatic format detection via magic bytes
- Unified CLI options across all formats
- Robust, portable builds with unit tests and
BUILD_PORTABLECMake option
([GitHub][2], [GitHub][1])
Build & Requirements
git clone https://github.com/acpguedes/ztail.git
cd ztail
mkdir build && cd build
cmake .. -DBUILD_TESTING=ON -DZTAIL_USE_THREADS=ON
make
ctest --output-on-failure # optionalOptional tuning flags:
-DZTAIL_USE_THREADS=OFF— disable threaded IO if unsupported-DBUILD_PORTABLE=ON— for cross-platform builds
([GitHub][1])
Quick Summary (for GitHub UI)
## v1.1.1 — Performance & Throughput Improvements
### Added / Improved
- Configurable read buffer (`-r/--read-buffer`) for optimized I/O.
- Larger zlib buffer to reduce syscalls during decompression.
- Disabled `iostream` ↔ `stdio` sync for faster `std::cout`.
- Batched output to minimize write overhead.
- Replaced `CharRingBuffer` with efficient circular buffer.
- Introduced double buffering with threads for overlapping I/O and parsing.
### Still Supports (from v1.1.0)
- `.gz`, `.bgz`, `.bz2`, `.xz`, `.zip`, `.zst` formats.
- Auto-detect compression format.
- Unified CLI flags, portable CMake build, and unit tests.
### Build Example
```bash
cmake .. -DBUILD_TESTING=ON -DZTAIL_USE_THREADS=ON
make
---