There was a great discussion a year ago about how fast gnu's version of "yes" is. If you're unfamiliar,
yes |head -5
The key takeaway was that
write is expensive and writing page-aligned buffers is much faster. The is true across languages, so let's see how to do it properly in go.
If you're shocked or impressed by the results, let's see you do it in your language -- post your results in the comments.
First, our benchmark C code from last-year's post.
/* yes.c - iteration 4 */
#define LEN 2
#define TOTAL …