Skip to main content

Module tac

Module tac 

Source

Functions§

tac_bytes
Reverse records separated by a single byte. Uses backward SIMD scan (memrchr_iter) to process records from back to front, building batched IoSlice references for zero-copy writev output. O(IOV_BATCH) memory — no positions Vec allocation needed at all. For 100MB/2.5M lines: saves ~20MB positions Vec + ~40MB IoSlice Vec.
tac_regex_separator
Reverse records using a regex separator. Uses regex::bytes for direct byte-level matching (no UTF-8 conversion needed). NOTE: GNU tac uses POSIX Basic Regular Expressions (BRE), so we convert to ERE first. Uses backward scanning to match GNU tac’s re_search behavior.
tac_string_separator
Reverse records using a multi-byte string separator. Uses SIMD-accelerated memmem for substring search.