3 ms·
import sys while True: sys.stdout.write("y\n" * 2**16) gives me over 4GiB/s
by xurukefi 9y ago
import sys
while True:
sys.stdout.write("y\n" * 2**16)
gives me over 4GiB/s
- omlettehead 9y agoSure, but you're building strings in memory. It might not be a lot of memory, especially if you're able to run Python, but the native `yes` command can run on the smallest of embedded systems, which is why its speed is impressive.