Comparing I/O Performance: Blocking I/O vs io_uring and kqueue with Programmer-Friendly Abstractions
By
enz
The kind of bagel that ruins lesser bagels for you.
Summary
This technical article explores I/O performance optimization by comparing different approaches to file and network operations. It starts with traditional blocking I/O, then examines modern asynchronous I/O mechanisms like io_uring (Linux) and kqueue (BSD/macOS), and ultimately presents a programmer-friendly abstraction layer that creates an event loop similar to familiar software patterns. The content is deeply technical, focusing on system programming, performance considerations, and cross-platform I/O abstractions for developers working with low-level file and network operations.
Key quotes
· 4 pulledWhen you want to read from a file you might open() and then call read() as many times as necessary to fill a buffer of bytes from the file.
This is a twist on King's talk at Software You Can Love Milan '22.
Consider this tale of I/O and performance. We'll start with blocking I/O, explore io_uring and kqueue, and take home an event loop very similar to some software you may find familiar.
It's similar for a TCP client with sockets, but instead of open() you first call socket() and then connect()
You might also wanna read
Optimizing .NET APIs for High Throughput: Techniques for 1M Requests Per Minute
Article discusses techniques for designing high-throughput .NET APIs capable of handling 1M requests per minute. It covers horizontal scalin

How micro-optimizations in Azure Service Bus SDK paved the way for a smarter redesign
The article discusses how micro-optimizations in the Azure Service Bus SDK led to meaningful design improvements. Rather than advocating for
How Kestra Improved Orchestrator Performance Across 14 Releases: A Year of Performance Engineering
Kestra's engineering team details their year-long performance engineering journey across releases 0.19 to 1.3, treating performance as an on
Optimizing Deep Learning Performance Through First-Principles Reasoning
The article discusses improving deep learning model performance by reasoning from first principles rather than relying on ad-hoc tricks and
Java Performance Optimization: Fixing 8 Common Anti-Patterns to Reduce Processing Time by 80%
The article presents a case study of Java performance optimization where fixing common anti-patterns dramatically improved application perfo
Understanding CPU Branch Prediction and Its Impact on Benchmarking
The article discusses how modern processors use branch prediction to execute multiple instructions per cycle, explaining that CPUs have rema
lemire.me·2mo ago