6 ms·
Seems like it's buffering output, which Python also does. Python is much slower if you flush every write (I get 2.6 MiB/s default, 600 KiB/s with flush=True).
by cle 4y ago
Seems like it's buffering output, which Python also does. Python is much slower if you flush every write (I get 2.6 MiB/s default, 600 KiB/s with flush=True).
Interestingly, Go is very fast with a 8 KiB buffer (same as Python's), I get 218 MiB/s.