Ask HN: Efficient Linux terminal output methods

https://news.ycombinator.com/item?id=46763174
by DenisDolya • 6 months ago
1 0 6 months ago

I’m exploring ways to write data from userspace to Linux terminals (stdout/stderr) with minimal CPU cycles, syscall overhead, and binary size, beyond the common methods I’ve considered write(), writev(), splice(), sendfile(), and io_uring—and I’d like to learn about other techniques or kernel interfaces that experienced developers use, including any lesser-known approaches, optimizations, or trade-offs; for each method, please indicate what makes it faster, more energy-efficient, or lighter in binary size, and share concrete examples, references, or microbenchmarks if available, so that I can compare options and understand real-world advantages and limitations.

Related Stories

Loading related stories...

Source preview

news.ycombinator.com