Here are some implementation to output numbers I found and the time to write [first 10.000.000 non-negative numbers] (base on Codeforces Custom Test // GNU G++ 17 7.3.0)
Putchar Non-recursive Implementation: 3649ms
Putchar Recursive Implementation: 3510ms
Putchar Reverse Implementation: 3462ms
Printf Implementation: 1762ms
synchronized(off) Implementation: 1356ms
synchronized(true) Implementation: 1060ms
Normal Implementation: 1045ms
fwrite buffer Implementation: 545ms
Here are some implementation to output numbers I found and the time to write [1.000 times first 10000 numbers] (base on Codeforces Custom Test // GNU G++ 17 7.3.0)
Putchar Reverse Implementation: 1981ms
Putchar Non-recursive Implementation: 1980ms
Putchar Recursive Implementation: 1887ms
Printf Implementation: 1216ms
synchronized(on) Implementation: 873ms
Normal Implementation: 873ms
synchronized(off) Implementation: 857ms
fwrite buffer Implementation: 311ms
Here are some implementation to output numbers I found and the time to write [first 10.000.000 non-positive numbers] (base on Codeforces Custom Test // GNU G++ 17 7.3.0)
Putchar Reverse Implementation: 3930ms
Putchar Recursive Implementation: 3915ms
Putchar Non-recursive Implementation: 3883ms
Printf Implementation: 1808ms
synchronized(off) Implementation: 1481ms
synchronized(true) Implementation: 1092ms
Normal Implementation: 1092ms
fwrite buffer Implementation: 561ms