C++ Output Implementations // Are there ways to perform faster ?

Revision en23, by SPyofgame, 2020-03-08 13:35:10

Here are some implementation to output numbers I found

Time to write first 10.000.000 non-negative numbers (base on Codeforces Custom Test // GNU G++ 17 7.3.0)

Putchar Non-recursive Dividing Implementation: 3649ms
Putchar Recursive Implementation: 3510ms
Putchar Reverse Implementation: 3462ms
Putchar Non-recursive toString Implementation: 3369ms
Printf Implementation: 1762ms
synchronized(off) Implementation: 1356ms
synchronized(true) Implementation: 1060ms
Normal Cout Implementation: 1045ms
fwrite buffer Implementation: 545ms

Time to write 1.000 times first 10000 numbers (base on [Codeforces Custom Test](https://codeforces.net/problemset/customtest) // GNU G++ 17 7.3.0)

Putchar Reverse Implementation: 1981ms
Putchar Non-recursive Dividing Implementation: 1980ms
Putchar Non-recursive toString Implementation: 1934ms
Putchar Recursive Implementation: 1887ms
Printf Implementation: 1216ms
synchronized(on) Implementation: 873ms
Normal Cout Implementation: 873ms
synchronized(off) Implementation: 857ms
fwrite buffer Implementation: 311ms

Time to write first 10.000.000 non-positive numbers (base on Codeforces Custom Test // GNU G++ 17 7.3.0)

Putchar Non-recursive toString Implementation: 3946ms
Putchar Reverse Implementation: 3930ms
Putchar Recursive Implementation: 3915ms
Putchar Non-recursive Dividing Implementation: 3883ms
Printf Implementation: 1808ms
synchronized(off) Implementation: 1481ms
synchronized(true) Implementation: 1092ms
Normal Cout Implementation: 1092ms
fwrite buffer Implementation: 561ms

Single Line Template

Putchar Non-recursive toString Implementation
Putchar Reverse Implementation
Putchar Recursive Implementation
Putchar Non-recursive Dividing Implementation
Printf Implementation
synchronized(off) Implementation
synchronized(true) Implementation
Cout Implementation
fwrite buffer Implementation

---------- About: ----------

Tags #c++

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en44 English SPyofgame 2020-06-06 17:24:10 2 Tiny change: '\n\n\n\n\n' -> '\n\n\n\n\n\n'
en43 English SPyofgame 2020-06-01 04:54:23 24664 Add Sort by Microsoft Visual C++ 2010 | Add Sort by Microsoft Visual C++ 2017
en42 English SPyofgame 2020-03-11 17:17:22 246
en41 English SPyofgame 2020-03-11 17:16:30 585
en40 English SPyofgame 2020-03-11 17:07:19 1028
en39 English SPyofgame 2020-03-11 16:19:02 5 Tiny change: '\n- _[C++ Output Implem' -> '\n- _[C++ Input Implem'
en38 English SPyofgame 2020-03-11 16:17:54 828
en37 English SPyofgame 2020-03-11 16:00:33 163
en36 English SPyofgame 2020-03-11 15:32:22 3
en35 English SPyofgame 2020-03-11 13:43:24 46 Tiny change: '-- \n\n- _Test ' -> '-- \n\n- _Start working on `Input Implementation`_\n- _Test '
en34 English SPyofgame 2020-03-11 12:13:31 13359
en33 English SPyofgame 2020-03-10 17:02:27 66
en32 English SPyofgame 2020-03-10 16:57:31 2020
en31 English SPyofgame 2020-03-10 16:45:15 17395
en30 English SPyofgame 2020-03-10 15:13:24 436
en29 English SPyofgame 2020-03-10 15:04:53 11184
en28 English SPyofgame 2020-03-09 17:08:42 23 Tiny change: '_\n- _New type of implementations (long lo' -> '_\n- _New output types (long lo'
en27 English SPyofgame 2020-03-09 17:08:00 107
en26 English SPyofgame 2020-03-09 17:04:42 56
en25 English SPyofgame 2020-03-09 17:02:11 259 Tiny change: ' 14 6.4.0`_\n- _Test' -> ' 14 6.4.0` for who_\n- _Test'
en24 English SPyofgame 2020-03-08 14:31:46 1 Tiny change: 'ementation to output' -> 'ementations to output'
en23 English SPyofgame 2020-03-08 13:35:10 56
en22 English SPyofgame 2020-03-08 13:34:24 62
en21 English SPyofgame 2020-03-08 13:32:27 151
en20 English SPyofgame 2020-03-08 13:31:05 22
en19 English SPyofgame 2020-03-08 13:30:04 643
en18 English SPyofgame 2020-03-08 13:23:01 2 Tiny change: 't[buf_len]. buf_num[b' -> 't[buf_len], buf_num[b'
en17 English SPyofgame 2020-03-08 13:21:59 2393
en16 English SPyofgame 2020-03-08 06:24:35 1405
en15 English SPyofgame 2020-03-08 05:43:13 2610
en14 English SPyofgame 2020-03-07 21:43:54 1881
en13 English SPyofgame 2020-03-07 21:05:24 16
en12 English SPyofgame 2020-03-07 21:00:12 68
en11 English SPyofgame 2020-03-07 17:34:09 40
en10 English SPyofgame 2020-03-07 13:05:13 3986
en9 English SPyofgame 2020-03-07 12:49:33 421
en8 English SPyofgame 2020-03-07 12:34:04 128
en7 English SPyofgame 2020-03-07 12:32:50 28
en6 English SPyofgame 2020-03-07 12:32:25 200
en5 English SPyofgame 2020-03-07 12:17:57 217
en4 English SPyofgame 2020-03-07 12:16:16 502
en3 English SPyofgame 2020-03-07 12:12:35 9
en2 English SPyofgame 2020-03-07 12:11:11 16 Tiny change: ' summary="Third Implement' -> ' summary="synchronized(off) Implement'
en1 English SPyofgame 2020-03-07 12:10:26 2318 Initial revision (published)