As to why they don't use similar techniques, probably because they historically didn't really care enough about the performances of yes(1) to bother with it.
FreeBSD has since added output buffering to yes(1), you can see the difference between openbsd yes(1)[0] which remains utterly naïve and freebsd yes(1)[1] which uses an 8k internal buffer.
[0]: https://github.com/openbsd/src/blob/master/usr.bin/yes/yes.c
[1]: https://svnweb.freebsd.org/base/head/usr.bin/yes/yes.c?view=...
I wouldn't be surprised if the BSD coreutils were more performant on older machines with small memory, buffers and prefetch queues (sometimes just a few bytes) than their GNU counterpart.
But generally GNU tends to focus on performance and features while BSD focuses on simplicity. GNU having ridiculously complex code to do trivial things is kind of a meme.
And also, most people don't need a ridiculously fast "yes". Usually, when you want a fast stream of bytes, for example to fill up some space, /dev/zero is a better option.
One of the reasons is that GNU had to reimlmement UNIX tools as GPL code. How do you reimplement something trivial without it looking as the original to avoid copyright claims? One of the solutions is to implement it as complicated as possible.
Meanwhile, its BSD version essentially sums up to "return 1".
Same for much of the GNU code:
- separate the people from the problem
- focus on interests, not positions
- invent options for mutual gain
- insist on using objective criteria
I'd hire that engineer!But then again, maybe the purpose is to swamp the input, maybe for testing, so the more the better, so, you never know and it's wrong to decide what all users don't need.