by 38 · 3y ago · 0 comments
package main
import "flag"
func main() {
yes := flag.String("m", "y", "message")
flag.Parse()
for {
println(*yes)
}
}https://www.reddit.com/r/unix/comments/6gxduc/how_is_gnu_yes...
* The fast version is still simple enough
* The general functionality being provided is to output arbitrary data repeatedly, and it can be useful to do this as fast as possible
With modern systems we can have 8 channel RAM and 128 PCIe lanes to feed a system stuffed with NVMe drives. The amount of throughput that can be obtained is nuts, and at that point all sorts of weird things can become an unexpected bottleneck.
This applies even in consumer systems. Suddenly your game loads far slower on a NVMe than it could because it never occurred to the programmer that instead of the disk, the JPEG decoder can become a bottleneck when you can read compressed data at 7 GB/s.
yes Go lines of code: 9
But for 'yes', I'd agree with you, though I guess the answer to "who cares?" is that whomever wrote it cared. They could have a legit performance reason or may just have done it to show they could.
https://news.ycombinator.com/item?id=27862463
I think this person is just mentally ill unfortunately.