DEV Community

Getting to Yes -- As Quickly as Possible

Tony Metzidis on March 29, 2019

There was a great discussion a year ago about how fast gnu's version of "yes" is. If you're unfamiliar, yes outputs y indefinitely. yes |head -5...
Collapse
 
detunized profile image
Dmitry Yakimenko • Edited

I'll bet the slowness in the first Go snippet comes from using fmt.Fprintln overhead and the fact you're writing 1 byte. It has nothing to do with page alignment, but rather with the buffering. You're writing many more bytes at once in the second example, doesn't matter aligned or not. Make the buffer of weird length, like 13377 bytes and try. I bet it will be as fast.

Collapse
 
tonymet profile image
Tony Metzidis

I was trying to encourage others to contribute 😂

Collapse
 
sebvercammen profile image
Sébastien Vercammen • Edited

Could be a good thing to communicate explicitly, and have a standard for. Like a hashtag, a name, ... something identifiable.

Concepts to explore or expand on, similar to open source repos that are perfect for beginners.