Skip to content

v1.1.1 — Performance & Throughput Improvements

Choose a tag to compare

@acpguedes acpguedes released this 14 Aug 10:35
· 35 commits to main since this release
fcb046f

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/​.bgz decompression to reduce the number of syscalls and improve throughput.

  • Disable Sync Between iostream and stdio
    Performance boost for output operations by turning off unnecessary synchronization when using std::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 previous CharRingBuffer (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.zst

Reiteration 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_PORTABLE CMake 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  # optional

Optional 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

---