4 ms·
Python pushes 15MiB on my M1 Pro if you go down a level and use sys directly. python3 -c 'import sys while (1): sys.stdout.write("1")'| pv>/dev/null
by klohto 4y ago
Python pushes 15MiB on my M1 Pro if you go down a level and use sys directly.
python3 -c 'import sys
while (1): sys.stdout.write("1")'| pv>/dev/null
- mg 4y agoThat caches though. You can see it when you strace it.
- klohto 4y agoGood point, but so does a standard print call. Calling flush() after each write does bring the perf to 1.5MiB
- rovr138 4y agopython3 -u -c 'import sys while (1): sys.stdout.write("1")'| pv>/dev/null 427KiB/s python3 -c 'import sys while (1): sys.stdout.write("1")'| pv>/dev/null 6.08MiB/s Using python 3.9.7 on macOS Monterey.