Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I never heard about anyone using yes to generate large data files/streams. Does anyone actually uses yes in a way that its daily CPU usage will be bigger than a rounding error?

Also very simple FreeBSD implementation [1] is not too slow on my 10-years old notebook:

  > time yes test_string | dd of=/dev/null bs=1M count=65536
  ...
  2646329200 bytes transferred in 1.709196 secs (1548288918 bytes/sec)
  0.023u 0.850s 0:01.71 50.8% 5+166k 0+0io 0pf+0w
Firefox probably have used more CPU time while I was composing this comment - thanks to JS (in other tabs, HN is a rare example of a site which doesn't abuse my CPU). FF is almost always on the 1st line in top.

If you'll check top/powertop and a typical desktop or a server you'll likely find better targets than 'yes' to reduce energy use.

[1] https://github.com/freebsd/freebsd-src/blob/main/usr.bin/yes...



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: