News for hackers. Stuff that matters.
Re:A Little Story About the `yes` Unix Command by jdnier on Wednesday October 11, 2017 @11:41PM (#15455502)
On my Macbook with way too much running, I get about 800MiB/s in Python2 with your script, but 1.12GiB/s with this Python3 script:

    import sys
    
    s = b'y\n' * 1024
    
    write = sys.stdout.buffer.write
    while True:
        write(s)
    
    # 1.12GiB/s
Plain old yes comes in at 22Mib/s.

The Python3 docs say to "use the underlying binary buffer object" when reading or writing binary data.

https://docs.python.org/3/library/sys.html

There are no comments on this comment yet.