3 ms·
My artisanal architecture design uses writes with a few characters and uses unix pipes: yes | pv > /dev/null I hope that in my next rewrite I can advance
by epistasis 1y ago
My artisanal architecture design uses writes with a few characters and uses unix pipes:
yes | pv > /dev/null
I hope that in my next rewrite I can advance to larger block sizes.
- fukka42 1y agoInterestingly I tried this as well and was disappointed with the results: yes $(printf %1024s | tr " " "y") | pv > /dev/null About the same throughput as letting yes output a single character. I guess Unix pipes are slow.
- 1718627440 1y ago> I guess Unix pipes are slow. Or string concatenation, or pipeviewer.
- fukka42 1y agoyes doesn't do string concatenation, at least not in the loop that matters. It just prepares a buffer of bytes once and writes it to stdout repeatedly. https://github.com/coreutils/coreutils/blob/master/src/yes.c https://github.com/coreutils/coreutils/blob/master/src/yes.c
- eru 1y agoCompare https://codegolf.stackexchange.com/questions/199528/fastest-yes-in-the-west https://codegolf.stackexchange.com/questions/199528/fastest-...