Constant-Time Sliding Window Aggregation: A Refined FIFO

2025-08-20

This post presents a refined FIFO data structure enabling constant-time sliding window aggregation. Traditional approaches using dual-stack structures prove inefficient. The author introduces a novel method, cleverly managing 'ingestion' and 'excretion' lists with their running and suffix products, to achieve aggregation over arbitrary monoids with worst-case constant-time complexity. This avoids the extensive copying and redundancy of prior methods, offering significant practical advantages. Python code is included for implementation.

Read more
(pvk.ca)
Development

VPTERNLOG: The Surprising Efficiency of Ternary Operators

2025-01-22

Paul Khuong's blog post explores VPTERNLOG, a novel instruction using ternary operators for bitvector reduction. Compared to binary operators, ternary operators reduce two values at a time, doubling efficiency. This means half the operations are needed when processing bitvectors, without sacrificing throughput or latency. The author praises VPTERNLOG as a cute, lightweight, and highly efficient instruction.

Read more
(pvk.ca)