Debian testing, AMD Threadripper 2950X, Linux 6.2.0-rc5 C gcc 12.2.0 0.027s # using `stdbuf -o8192` and fputs_unlocked D ldc2 1.30.0 / llvm 14.0.6 0.034s # using stdout.lockingTextWriter.put("....\n"), and `stdbuf -o8192` D gdc 12.2.0 0.038s # using stdout.lockingTextWriter.put("....\n"), and `stdbuf -o8192` go go1.19.6 0.053s # bufio.NewWriter(os.Stdout).WriteString, default size (4096) D gdc 12.2.0 0.061s # using stdout.lockingTextWriter.put("....\n"), still not buffering correctly C++ gcc 12.2.0 0.065s # using std::cout, no std::endl, and with stdbuf -o65536 C++ clang 15.0.7 0.077s # using std::cout, no std::endl, and with standard buffering (4096) C++ gcc 12.2.0 0.082s # using std::cout, no std::endl, and with standard buffering (4096) luajit 2.1.0-beta3 0.148s # this is not even using optimal buffering yet! D gdc 12.2.0 0.265s # not including compilation. using writeln("...") # this was done on sshfs, but repeat in tmpfs show similar perf. perl 5.36.0 0.143s # nice buffering out of the box (8192) D ldc2 1.30.0 / llvm 14.0.6 0.146s # not including compilation. using writeln("...") python3-pypy 7.3.11 0.158s 9base-awk 19990602 (9base 1:6-13) 0.207s gawk 5.2.1 0.319s python3 3.11.2 0.589s ruby 3.1.2p20 0.902s # calls CLOCK_PROCESS_CPUTIME_ID super frequently (every time it flushes buffers). nice buffering out of the box ~8K and writev php 8.2.2 6.855s go go1.19.6 7.309s # using os.Stdout.WriteString lua 5.3.6 8.306s tcl 8.6.13 13.791s dash 0.5.12-2 17.606s # while loop bash 5.2.15 24.230s # bash-style for loop bash 5.2.15 34.388s # while loop nodejs v18.13.0. 23.377s / 23.072s # console.log zsh 5.9 69.172s # jizus