Runtime performance

Environments
Label Library type Compiler OS

VS / ho

header-only

Visual Studio 2019 (16.5.4)

Windows 10

VS / s

static

GCC / ho

header-only

GCC 10.2.0

Ubuntu 20.04.1

GCC / s

static

Clang / ho

header-only

Clang 10.0.0

Clang / s

static

The benchmarks programs were all run in the same computer and compiled in C++20. The {fmt} version is 7.1.3

You can replicate them in your environment by executing the following commands:

git clone https://github.com/robhz786/strf-benchmarks
cd strf-benchmarks
git submodule update --init
mkdir build
cd build

cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_STANDARD=20 ..
# ( CMAKE_CXX_STANDARD must be 17 or higher )

cmake --build . --target to_char_ptr-static-lib
cmake --build . --target to_char_ptr-header-only
cmake --build . --target to_string-static-lib
cmake --build . --target to_string-header-only
# ( and/or build other targets )

./to_char_ptr-static-lib
./to_char_ptr-header-only
./to_string-static-lib
./to_string-header-only
# ( and/or run other benchmarks )

Writing to char*

Sample 1

Print a string

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf::to(…​)(…​)

16.9 ns

16.0 ns

11.9 ns

19.0 ns

15.7 ns

18.2 ns

2. strf::to(…​).tr(…​)

26.1 ns

24.9 ns

21.4 ns

21.4 ns

17.2 ns

19.4 ns

3. fmt::format_to / FMT_COMPILE

6.45 ns

6.70 ns

11.4 ns

11.3 ns

4.22 ns

3.43 ns

4. fmt::format_to_n / FMT_COMPILE

92.1 ns

92.1 ns

129 ns

130 ns

14.2 ns

15.4 ns

5. fmt::format_to

41.4 ns

43.9 ns

27.7 ns

31.4 ns

23.2 ns

26.0 ns

6. fmt::format_to_n

53.1 ns

56.3 ns

34.2 ns

39.3 ns

26.4 ns

29.4 ns

7. std::sprintf

105 ns

61.7 ns

62.7 ns

  1. strf::to(dest, dest_size)("Blah ", str, "!\n")

  2. strf::to(dest, dest_size).tr("Blah {}!\n", str)

  3. fmt::format_to(dest, FMT_COMPILE("Blah {}!\n"), str)

  4. fmt::format_to_n(dest, dest_size, FMT_COMPILE("Blah {}!\n"), str)

  5. fmt::format_to(dest, "Blah {}!\n", str)

  6. fmt::format_to_n(dest, dest_size, "Blah {}!\n", str)

  7. std::sprintf(dest, "Blah %s!\n", str.c_str())

using
    constexpr std::size_t dest_size = 110;
    char dest[dest_size];
    std::string str = "blah blah blah blah blah blah blah";

Sample 2

Print integer without formatting

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf::to(…​)(…​)

31.4 ns

31.4 ns

14.0 ns

35.6 ns

28.4 ns

31.0 ns

2. strf::to(…​).tr(…​)

47.1 ns

54.4 ns

33.1 ns

33.3 ns

33.2 ns

37.3 ns

3. fmt::format_to / FMT_COMPILE

17.3 ns

16.4 ns

10.8 ns

10.8 ns

3.17 ns

3.43 ns

4. fmt::format_to_n / FMT_COMPILE

97.7 ns

100 ns

170 ns

171 ns

42.5 ns

36.8 ns

5. fmt::format_to

78.5 ns

78.5 ns

54.0 ns

57.4 ns

43.8 ns

48.5 ns

6. fmt::format_to_n

85.4 ns

81.6 ns

60.6 ns

64.4 ns

47.2 ns

53.7 ns

7. std::sprintf

153 ns

112 ns

111 ns

  1. strf::to(dest)("blah ", 123456, " blah ", 0x123456, " blah")

  2. strf::to(dest).tr("blah {} blah {} blah", 123456, 0x123456)

  3. fmt::format_to(dest, FMT_COMPILE("blah {} blah {} blah"), 123456, 0x123456)

  4. fmt::format_to_n(dest, dest_size, FMT_COMPILE("blah {} blah {} blah"), 123456, 0x123456)

  5. fmt::format_to(dest, "blah {} blah {} blah", 123456, 0x123456)

  6. fmt::format_to_n(dest, dest_size, "blah {} blah {} blah", 123456, 0x123456)

  7. std::sprintf(dest, "blah %d blah %d blah", 123456, 0x123456)

using
    constexpr std::size_t dest_size = 110;
    char dest[dest_size];

Sample 3

Print some formatted integers

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf::to(…​)(…​)

69.8 ns

64.2 ns

19.3 ns

54.9 ns

48.2 ns

56.5 ns

2. strf::to(…​).tr(…​)

83.7 ns

83.7 ns

39.8 ns

62.2 ns

56.3 ns

63.5 ns

3. fmt::format_to / FMT_COMPILE

109 ns

107 ns

57.7 ns

55.3 ns

42.8 ns

41.5 ns

4. fmt::format_to_n / FMT_COMPILE

246 ns

246 ns

364 ns

347 ns

187 ns

188 ns

5. fmt::format_to

184 ns

204 ns

120 ns

121 ns

130 ns

132 ns

6. fmt::format_to_n

197 ns

199 ns

128 ns

134 ns

137 ns

143 ns

7. std::sprintf

188 ns

117 ns

116 ns

  1. strf::to(dest)("blah ", +strf::dec(123456), " blah ", *strf::hex(0x123456), " blah")

  2. strf::to(dest).tr("blah {} blah {} blah", +strf::dec(123456), *strf::hex(0x123456))

  3. fmt::format_to(dest, FMT_COMPILE("blah {:+} blah {:#x} blah"), 123456, 0x123456)

  4. fmt::format_to_n(dest, dest_size, FMT_COMPILE("blah {:+} blah {:#x} blah"), 123456, 0x123456)

  5. fmt::format_to(dest, "blah {:+} blah {:#x} blah", 123456, 0x123456)

  6. fmt::format_to_n(dest, dest_size, "blah {:+} blah {:#x} blah", 123456, 0x123456)

  7. std::sprintf(dest, "blah %+d blah %#x blah", 123456, 0x123456)

using
    constexpr std::size_t dest_size = 110;
    char dest[dest_size];

Sample 4

Print some formatted integers with alignment

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf::to(…​)(…​)

76.7 ns

73.2 ns

27.5 ns

67.0 ns

58.3 ns

77.0 ns

2. strf::to(…​).tr(…​)

112 ns

94.2 ns

47.1 ns

73.3 ns

64.9 ns

79.5 ns

3. fmt::format_to / FMT_COMPILE

110 ns

112 ns

59.7 ns

70.3 ns

49.7 ns

54.5 ns

4. fmt::format_to_n / FMT_COMPILE

300 ns

298 ns

394 ns

393 ns

190 ns

192 ns

5. fmt::format_to

225 ns

235 ns

169 ns

146 ns

164 ns

164 ns

6. fmt::format_to_n

235 ns

241 ns

165 ns

151 ns

161 ns

164 ns

7. std::sprintf

361 ns

158 ns

160 ns

  1. strf::to(dest)("blah ", +strf::right(123456, 20, '_'), " blah ", *strf::hex(0x123456)<20, " blah")

  2. strf::to(dest).tr("blah {} blah {} blah", +strf::right(123456, 20, '_'), *strf::hex(0x123456)<20)

  3. fmt::format_to(dest, FMT_COMPILE("blah {:_>+20} blah {:<#20x} blah"), 123456, 0x123456)

  4. fmt::format_to_n(dest, dest_size, FMT_COMPILE("blah {:_>+20} blah {:<#20x} blah"), 123456, 0x123456)

  5. fmt::format_to(dest, "blah {:_>+20} blah {:<#20x} blah", 123456, 0x123456)

  6. fmt::format_to_n(dest, dest_size, "blah {:_>+20} blah {:<#20x} blah", 123456, 0x123456)

  7. std::sprintf(dest, "blah %+20d blah %#-20x blah", 123456, 0x123456)

using
    constexpr std::size_t dest_size = 110;
    char dest[dest_size];

Writing to std::string

std::to_string versus strf::to_string versus fmt::format

Sample 1

Print an integer and nothing more.

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

34.5 ns

36.8 ns

12.1 ns

15.0 ns

19.4 ns

19.3 ns

2. strf (no_reserve)

19.9 ns

19.9 ns

15.3 ns

18.2 ns

16.5 ns

19.4 ns

3. strf (reserve_calc, tr)

44.9 ns

43.5 ns

26.1 ns

28.1 ns

35.3 ns

31.7 ns

4. strf (no_reserve, tr)

33.0 ns

30.7 ns

22.2 ns

23.8 ns

30.4 ns

30.9 ns

5. {fmt} (FMT_COMPILE)

14.1 ns

14.1 ns

8.71 ns

8.73 ns

1.58 ns

7.39 ns

6. {fmt}

35.3 ns

35.3 ns

21.4 ns

21.0 ns

11.0 ns

11.2 ns

7. std::to_string

17.0 ns

5.28 ns

7.79 ns

  1. to_string .reserve_calc() (123456)

  2. to_string .no_reserve() (123456)

  3. to_string .reserve_calc() .tr("{}", 123456)

  4. to_string .no_reserve() .tr("{}", 123456)

  5. fmt::format(FMT_COMPILE("{}"), 123456)

  6. fmt::format("{}", 123456)

  7. std::to_string(123456)

Sample 2

Print a floting point value and nothing more.

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

98.4 ns

87.9 ns

44.9 ns

47.9 ns

54.7 ns

71.2 ns

2. strf (no_reserve)

67.0 ns

69.8 ns

44.5 ns

47.8 ns

50.5 ns

53.2 ns

3. strf (reserve_calc, tr)

112 ns

97.7 ns

70.4 ns

63.6 ns

76.1 ns

88.1 ns

4. strf (no_reserve, tr)

82.0 ns

73.2 ns

53.0 ns

59.9 ns

59.7 ns

72.6 ns

5. {fmt} (FMT_COMPILE)

53.0 ns

48.7 ns

34.5 ns

32.0 ns

36.8 ns

47.0 ns

6. {fmt}

68.4 ns

65.6 ns

42.6 ns

43.5 ns

47.4 ns

55.0 ns

7. std::to_string

537 ns

201 ns

216 ns

  1. to_string .reserve_calc() (0.123456)

  2. to_string .no_reserve() (0.123456)

  3. to_string .reserve_calc() .tr("{}", 0.123456)

  4. to_string .no_reserve() .tr("{}", 0.123456)

  5. fmt::format(FMT_COMPILE("{}"), 0.123456)

  6. fmt::format("{}", 0.123456)

  7. std::to_string(0.123456)

Sample 3

Print a string

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

92.1 ns

94.2 ns

29.4 ns

32.4 ns

39.6 ns

37.2 ns

2. strf (no_reserve)

96.3 ns

96.3 ns

33.2 ns

45.2 ns

50.6 ns

55.1 ns

3. strf (reserve_calc, tr)

126 ns

117 ns

53.1 ns

53.5 ns

58.0 ns

61.8 ns

4. strf (no_reserve, tr)

112 ns

109 ns

49.2 ns

52.7 ns

57.2 ns

60.1 ns

5. {fmt} (FMT_COMPILE)

92.1 ns

92.1 ns

25.0 ns

26.2 ns

40.0 ns

40.3 ns

6. {fmt}

120 ns

126 ns

56.7 ns

56.4 ns

53.1 ns

51.0 ns

  1. to_string .reserve_calc() ("Blah ", str, "!\n")

  2. to_string .no_reserve() ("Blah ", str, "!\n")

  3. to_string .reserve_calc() .tr("Blah {}!\n", str)

  4. to_string .no_reserve() .tr("Blah {}!\n", str)

  5. fmt::format(FMT_COMPILE("Blah {}!\n"), str)

  6. fmt::format("Blah {}!\n", str)

using
    std::string str = "blah blah blah blah blah blah blah";

Sample 4

Print integers without formatting

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

117 ns

112 ns

31.1 ns

48.8 ns

64.5 ns

63.7 ns

2. strf (no_reserve)

117 ns

117 ns

31.0 ns

60.5 ns

68.3 ns

73.6 ns

3. strf (reserve_calc, tr)

154 ns

143 ns

69.8 ns

70.2 ns

81.6 ns

89.6 ns

4. strf (no_reserve, tr)

135 ns

131 ns

61.0 ns

65.4 ns

83.9 ns

80.3 ns

5. {fmt} (FMT_COMPILE)

103 ns

100 ns

35.2 ns

35.0 ns

53.1 ns

48.7 ns

6. {fmt}

150 ns

165 ns

85.6 ns

87.7 ns

77.4 ns

71.5 ns

  1. to_string .reserve_calc() ("blah ", 123456, " blah ", 0x123456, " blah")

  2. to_string .no_reserve() ("blah ", 123456, " blah ", 0x123456, " blah")

  3. to_string .reserve_calc() .tr("blah {} blah {} blah", 123456, 0x123456)

  4. to_string .no_reserve() .tr("blah {} blah {} blah", 123456, 0x123456)

  5. fmt::format(FMT_COMPILE("blah {} blah {} blah"), 123456, 0x123456)

  6. fmt::format("blah {} blah {} blah", 123456, 0x123456)

Sample 5

Print integers with some basic formatting

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

150 ns

151 ns

65.6 ns

81.0 ns

85.9 ns

109 ns

2. strf (no_reserve)

150 ns

151 ns

66.0 ns

75.7 ns

105 ns

103 ns

3. strf (reserve_calc, tr)

193 ns

188 ns

98.0 ns

98.9 ns

113 ns

115 ns

4. strf (no_reserve, tr)

169 ns

165 ns

86.2 ns

85.7 ns

111 ns

117 ns

5. {fmt} (FMT_COMPILE)

220 ns

220 ns

103 ns

101 ns

89.2 ns

93.4 ns

6. {fmt}

267 ns

283 ns

154 ns

152 ns

161 ns

158 ns

  1. to_string_rc("blah ", +strf::dec(123456), " blah ", *strf::hex(0x123456), " blah")

  2. to_string_nr("blah ", +strf::dec(123456), " blah ", *strf::hex(0x123456), " blah")

  3. to_string_rc.tr("blah {} blah {} blah", +strf::dec(123456), *strf::hex(0x123456))

  4. to_string_nr.tr("blah {} blah {} blah", +strf::dec(123456), *strf::hex(0x123456))

  5. fmt::format(FMT_COMPILE("blah {:+} blah {:#x} blah"), 123456, 0x123456)

  6. fmt::format("blah {:+} blah {:#x} blah", 123456, 0x123456)

using
    constexpr auto to_string_rc = strf::to_string.reserve_calc();
    constexpr auto to_string_nr = strf::to_string.no_reserve();

Sample 6

Print some formatted integers with alignment

VS/ho VS/s GCC/ho GCC/s Clang/ho Clang/s

1. strf (reserve_calc)

197 ns

176 ns

76.8 ns

83.1 ns

94.5 ns

113 ns

2. strf (no_reserve)

165 ns

167 ns

77.0 ns

96.3 ns

110 ns

109 ns

3. strf (reserve_calc, tr)

215 ns

209 ns

107 ns

104 ns

122 ns

134 ns

4. strf (no_reserve, tr)

184 ns

180 ns

97.8 ns

99.6 ns

126 ns

125 ns

5. {fmt} (FMT_COMPILE)

246 ns

246 ns

115 ns

131 ns

107 ns

116 ns

6. {fmt}

328 ns

330 ns

167 ns

195 ns

192 ns

187 ns

  1. to_string_rc("blah ", +strf::right(123456, 20, '_'), " blah ", *strf::hex(0x123456)<20, " blah")

  2. to_string_nr("blah ", +strf::right(123456, 20, '_'), " blah ", *strf::hex(0x123456)<20, " blah")

  3. to_string_rc.tr("blah {} blah {} blah", +strf::right(123456, 20, '_'), *strf::hex(0x123456)<20)

  4. to_string_nr.tr("blah {} blah {} blah", +strf::right(123456, 20, '_'), *strf::hex(0x123456)<20)

  5. fmt::format(FMT_COMPILE("blah {:_>+20} blah {:<#20x} blah"), 123456, 0x123456)

  6. fmt::format("blah {:_>+20} blah {:<#20x} blah", 123456, 0x123456)

using
    constexpr auto to_string_rc = strf::to_string.reserve_calc();
    constexpr auto to_string_nr = strf::to_string.no_reserve();

Compilation performance

You can run these benchmarks in your computer by executing the commands below ( it does not work on Windows ).

git clone https://github.com/robhz786/strf-benchmarks
cd strf-benchmarks
git submodule update --init
cd compilation-benchmarks
export CXX=gcc              # or some other compiler
export CXXFLAGS=--std=c++2a # or some other compile flag ( optional )
./run_benchmarks.py         # this script takes a long time to run

For each row in the tables below, the source file in the leftmost column is compiled 41 times. In each compilation, a certain macro ( SRC_ID ) is defined with a different value, resulting in 41 different object files. The script then links four programs: The first one containing only one of such object files, the second containing 21, the the third with 31, and the last program with all the 41 object files.

The rightmost column is the difference between the values in the columns "31 files" and "41 files".

The comlumn "Compilation times" shows the average times to create one object file.

The flag --std=c++2a was used.

Clang 10.0.0

Static libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.68

0.65

0.02

471.9

609.7

629.8

645.9

16.0

to_charptr_strf_tr.cpp

0.69

0.67

0.02

471.5

611.2

626.1

645.0

18.9

to_charptr_fmtlib_n_c.cpp

1.54

1.52

0.02

599.1

865.0

895.0

916.8

21.8

to_charptr_fmtlib_n.cpp

0.44

0.42

0.02

556.7

583.1

596.2

609.4

13.2

to_charptr_fmtlib_c.cpp

1.10

1.07

0.02

574.7

711.1

737.0

758.9

21.8

to_charptr_fmtlib.cpp

0.42

0.40

0.02

556.5

565.9

574.8

583.6

8.8

to_charptr_sprintf.cpp

0.02

0.02

0.00

16.5

21.9

26.6

31.4

4.7

to_string_strf.cpp

0.77

0.75

0.02

478.4

639.8

665.3

686.8

21.5

to_string_strf_tr.cpp

0.82

0.79

0.02

477.8

645.0

669.4

693.8

24.4

to_string_fmtlib_c.cpp

1.27

1.25

0.02

565.1

767.0

806.1

845.2

39.1

to_string_fmtlib.cpp

0.39

0.37

0.01

556.5

571.7

585.5

595.2

9.7

to_FILE_strf.cpp

0.67

0.65

0.02

472.0

610.2

626.3

642.4

16.1

to_FILE_strf_tr.cpp

0.69

0.67

0.02

471.6

607.6

622.5

641.6

19.0

to_FILE_fmtlib.cpp

0.37

0.35

0.01

552.0

561.6

566.4

571.3

4.8

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.5

22.1

22.8

27.6

4.8

to_ostream_strf.cpp

0.90

0.87

0.02

472.4

614.2

630.7

647.2

16.5

to_ostream_strf_tr.cpp

0.92

0.88

0.03

471.8

611.2

630.6

645.9

15.3

to_ostream_fmtlib.cpp

0.59

0.57

0.02

552.4

563.3

568.7

578.2

9.5

Header-only libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.02

0.99

0.02

79.1

221.5

247.7

269.7

22.1

to_charptr_strf_tr.cpp

1.04

1.01

0.02

78.7

227.2

248.0

268.9

20.9

to_charptr_fmtlib_n_c.cpp

2.22

2.18

0.04

92.7

374.7

408.4

442.0

33.6

to_charptr_fmtlib_n.cpp

2.01

1.98

0.03

115.1

170.7

202.7

230.5

27.8

to_charptr_fmtlib_c.cpp

1.76

1.72

0.03

68.6

224.9

250.4

284.0

33.6

to_charptr_fmtlib.cpp

1.99

1.96

0.03

114.8

157.7

181.2

200.6

19.4

to_string_strf.cpp

1.12

1.09

0.02

89.5

255.1

282.4

309.6

27.3

to_string_strf_tr.cpp

1.16

1.13

0.02

84.9

260.3

290.5

320.6

30.2

to_string_fmtlib_c.cpp

1.84

1.80

0.03

81.4

299.4

346.2

393.0

46.8

to_string_fmtlib.cpp

2.32

2.28

0.03

142.5

201.3

230.7

260.2

29.4

to_FILE_strf.cpp

1.01

0.98

0.02

79.2

222.0

244.1

266.3

22.2

to_FILE_strf_tr.cpp

1.03

1.01

0.02

78.7

223.5

244.5

265.4

21.0

to_FILE_fmtlib.cpp

2.34

2.31

0.03

143.8

195.3

221.1

246.8

25.8

to_ostream_strf.cpp

1.27

1.23

0.03

79.5

226.0

248.5

271.1

22.5

to_ostream_strf_tr.cpp

1.35

1.31

0.03

78.9

227.1

252.5

269.7

17.2

to_ostream_fmtlib.cpp

2.02

1.98

0.03

114.9

155.1

175.2

199.4

24.2

Static libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.70

0.68

0.02

472.8

649.7

669.4

689.0

19.7

to_charptr_strf_tr.cpp

0.74

0.72

0.02

472.1

667.6

682.2

696.9

14.6

to_charptr_fmtlib_n_c.cpp

1.75

1.72

0.02

597.8

795.2

833.4

875.8

42.3

to_charptr_fmtlib_n.cpp

0.44

0.42

0.01

556.7

587.2

600.3

617.6

17.3

to_charptr_fmtlib_c.cpp

1.22

1.20

0.02

575.8

666.5

700.7

734.8

34.1

to_charptr_fmtlib.cpp

0.42

0.40

0.01

556.5

570.0

574.8

583.6

8.8

to_charptr_sprintf.cpp

0.02

0.02

0.00

16.5

21.9

26.6

31.4

4.7

to_string_strf.cpp

0.82

0.79

0.02

474.9

669.6

698.9

719.9

21.1

to_string_strf_tr.cpp

0.86

0.83

0.02

474.2

682.6

710.7

730.6

19.9

to_string_fmtlib_c.cpp

1.60

1.57

0.03

576.8

875.4

951.3

1023.2

71.9

to_string_fmtlib.cpp

0.39

0.37

0.02

556.5

571.7

585.5

595.2

9.7

to_FILE_strf.cpp

0.71

0.69

0.02

473.1

646.5

662.4

682.4

20.0

to_FILE_strf_tr.cpp

0.75

0.72

0.02

472.1

667.0

685.8

696.4

10.6

to_FILE_fmtlib.cpp

0.38

0.36

0.01

552.0

561.6

566.4

571.3

4.8

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.5

22.1

22.8

27.6

4.8

to_ostream_strf.cpp

0.94

0.90

0.03

468.0

660.0

679.4

694.7

15.3

to_ostream_strf_tr.cpp

0.97

0.94

0.03

472.2

667.3

686.5

697.5

11.0

to_ostream_fmtlib.cpp

0.62

0.59

0.02

557.2

618.0

624.6

635.3

10.7

Header-only libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.20

1.17

0.02

87.2

281.5

307.1

332.8

25.7

to_charptr_strf_tr.cpp

1.23

1.20

0.02

86.5

290.7

307.2

331.9

24.7

to_charptr_fmtlib_n_c.cpp

2.61

2.57

0.04

93.8

304.2

348.7

393.1

44.5

to_charptr_fmtlib_n.cpp

2.53

2.49

0.04

126.1

187.0

217.5

248.0

30.5

to_charptr_fmtlib_c.cpp

2.07

2.03

0.04

67.8

175.5

211.7

256.2

44.5

to_charptr_fmtlib.cpp

2.51

2.47

0.03

125.8

169.9

192.0

214.0

22.1

to_string_strf.cpp

1.31

1.28

0.02

89.4

291.8

327.1

354.1

27.1

to_string_strf_tr.cpp

1.34

1.31

0.02

92.7

309.8

339.8

365.7

25.9

to_string_fmtlib_c.cpp

2.33

2.29

0.04

90.5

406.2

484.3

566.5

82.2

to_string_fmtlib.cpp

2.90

2.86

0.03

156.8

212.7

240.7

268.7

28.0

to_FILE_strf.cpp

1.19

1.17

0.02

87.2

273.5

295.4

321.4

26.0

to_FILE_strf_tr.cpp

1.22

1.19

0.02

86.5

284.9

309.7

334.5

24.8

to_FILE_fmtlib.cpp

2.92

2.88

0.04

157.9

206.0

230.1

254.2

24.1

to_ostream_strf.cpp

1.49

1.45

0.03

85.5

328.4

353.9

375.2

21.3

to_ostream_strf_tr.cpp

1.45

1.41

0.03

86.6

286.3

311.4

332.5

21.1

to_ostream_fmtlib.cpp

2.54

2.50

0.03

126.5

217.9

237.8

261.7

24.0

Static libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.58

0.56

0.02

955.0

3899.2

5242.0

6580.6

1338.6

to_charptr_strf_tr.cpp

0.59

0.57

0.02

984.1

4413.7

5836.3

7267.1

1430.8

to_charptr_fmtlib_n_c.cpp

0.81

0.78

0.03

1129.4

6437.8

8373.0

10300.6

1927.6

to_charptr_fmtlib_n.cpp

0.41

0.39

0.02

640.2

1604.2

1981.2

2362.3

381.1

to_charptr_fmtlib_c.cpp

0.76

0.73

0.03

979.2

5630.8

7452.1

9269.6

1817.6

to_charptr_fmtlib.cpp

0.41

0.39

0.02

636.5

1539.5

1897.1

2254.7

357.6

to_charptr_sprintf.cpp

0.02

0.01

0.00

29.6

179.6

252.6

325.6

73.0

to_string_strf.cpp

0.65

0.62

0.02

996.1

4159.3

5605.0

7050.8

1445.8

to_string_strf_tr.cpp

0.66

0.63

0.02

1027.1

4727.6

6274.7

7817.7

1543.0

to_string_fmtlib_c.cpp

0.83

0.80

0.03

945.4

5979.2

7946.7

9914.8

1968.1

to_string_fmtlib.cpp

0.37

0.36

0.01

647.3

1575.0

1952.9

2322.5

369.7

to_FILE_strf.cpp

0.58

0.55

0.03

957.9

3945.0

5313.8

6672.9

1359.2

to_FILE_strf_tr.cpp

0.60

0.57

0.02

987.0

4464.7

5909.5

7361.1

1451.6

to_FILE_fmtlib.cpp

0.38

0.36

0.01

625.4

1457.0

1763.6

2074.4

310.7

to_FILE_fprintf.cpp

0.02

0.01

0.00

29.4

173.1

244.9

312.6

67.7

to_ostream_strf.cpp

0.82

0.78

0.03

970.1

3991.9

5371.0

6752.9

1381.8

to_ostream_strf_tr.cpp

0.83

0.79

0.03

999.9

4529.6

5998.3

7465.6

1467.3

to_ostream_fmtlib.cpp

0.59

0.56

0.02

657.3

1709.7

2139.7

2577.9

438.2

Header-only libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.66

0.63

0.02

651.7

4492.2

6280.0

8067.8

1787.8

to_charptr_strf_tr.cpp

0.67

0.64

0.03

679.9

4993.8

6859.5

8729.3

1869.8

to_charptr_fmtlib_n_c.cpp

1.26

1.22

0.04

783.2

7155.3

9615.5

12075.6

2460.1

to_charptr_fmtlib_n.cpp

1.09

1.05

0.04

690.5

5496.0

7797.8

10103.7

2305.9

to_charptr_fmtlib_c.cpp

1.20

1.15

0.04

638.9

6355.1

8705.7

11047.9

2342.2

to_charptr_fmtlib.cpp

1.09

1.05

0.04

679.7

5445.8

7730.8

10015.8

2285.0

to_string_strf.cpp

0.74

0.70

0.03

693.3

4761.4

6660.5

8555.5

1895.0

to_string_strf_tr.cpp

0.75

0.72

0.03

727.2

5308.1

7294.2

9280.3

1986.0

to_string_fmtlib_c.cpp

1.19

1.14

0.04

703.3

6683.8

9127.9

11563.8

2435.8

to_string_fmtlib.cpp

1.17

1.12

0.04

831.9

6424.3

9128.4

11836.6

2708.2

to_FILE_strf.cpp

0.68

0.65

0.02

654.8

4544.2

6360.6

8172.4

1811.9

to_FILE_strf_tr.cpp

0.69

0.66

0.03

683.0

5051.1

6941.4

8835.3

1894.0

to_FILE_fmtlib.cpp

1.16

1.12

0.04

845.7

6591.7

9357.3

12127.0

2769.7

to_ostream_strf.cpp

0.89

0.85

0.03

666.9

4589.9

6420.0

8249.8

1829.8

to_ostream_strf_tr.cpp

0.90

0.86

0.03

695.3

5103.4

7011.6

8915.4

1903.7

to_ostream_fmtlib.cpp

1.10

1.06

0.04

692.1

5461.7

7752.5

10039.1

2286.6

GCC 9.3.0

Static libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.71

0.66

0.04

489.9

672.8

690.6

712.7

22.1

to_charptr_strf_tr.cpp

0.72

0.68

0.04

489.9

658.1

688.2

718.6

30.3

to_charptr_fmtlib_n_c.cpp

1.20

1.15

0.05

559.6

789.3

838.9

884.3

45.4

to_charptr_fmtlib_n.cpp

0.53

0.49

0.04

514.9

528.4

537.3

542.0

4.7

to_charptr_fmtlib_c.cpp

1.02

0.97

0.05

533.6

624.8

649.6

678.4

28.8

to_charptr_fmtlib.cpp

0.52

0.48

0.04

514.6

524.0

536.9

541.7

4.7

to_charptr_sprintf.cpp

0.02

0.01

0.00

16.6

21.9

26.7

31.4

4.7

to_string_strf.cpp

0.77

0.72

0.04

491.5

695.1

722.1

745.2

23.1

to_string_strf_tr.cpp

0.80

0.75

0.04

492.0

694.1

725.3

760.7

35.4

to_string_fmtlib_c.cpp

1.15

1.10

0.05

526.0

649.1

683.0

717.0

33.9

to_string_fmtlib.cpp

0.44

0.41

0.03

514.1

532.8

538.0

543.3

5.3

to_FILE_strf.cpp

0.70

0.66

0.04

489.6

667.8

685.8

703.8

18.1

to_FILE_strf_tr.cpp

0.72

0.68

0.04

489.7

658.1

680.2

710.6

30.4

to_FILE_fmtlib.cpp

0.42

0.39

0.03

513.9

523.6

528.4

537.3

8.9

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.6

22.1

26.9

27.7

0.7

to_ostream_strf.cpp

0.75

0.71

0.04

489.9

675.5

693.4

715.5

22.1

to_ostream_strf_tr.cpp

0.77

0.73

0.04

490.1

655.9

682.0

708.3

26.3

to_ostream_fmtlib.cpp

0.54

0.49

0.04

514.5

524.0

532.9

537.6

4.8

Header-only libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.10

1.05

0.04

74.8

256.8

279.0

301.3

22.3

to_charptr_strf_tr.cpp

1.11

1.06

0.04

74.9

250.3

280.7

303.0

22.3

to_charptr_fmtlib_n_c.cpp

1.69

1.62

0.06

92.0

339.6

394.1

448.6

54.5

to_charptr_fmtlib_n.cpp

1.87

1.80

0.06

109.6

165.6

193.6

221.6

28.0

to_charptr_fmtlib_c.cpp

1.51

1.45

0.06

66.4

171.9

209.7

243.5

33.8

to_charptr_fmtlib.cpp

1.87

1.80

0.07

105.2

161.2

189.2

217.2

28.0

to_string_strf.cpp

1.17

1.12

0.05

84.7

282.3

309.6

337.0

27.4

to_string_strf_tr.cpp

1.20

1.15

0.05

85.5

287.2

322.7

354.2

31.5

to_string_fmtlib_c.cpp

1.59

1.53

0.05

77.9

223.6

266.5

305.4

38.9

to_string_fmtlib.cpp

2.13

2.06

0.06

127.2

193.3

226.4

259.5

33.1

to_FILE_strf.cpp

1.11

1.06

0.05

74.5

248.1

266.3

288.7

22.4

to_FILE_strf_tr.cpp

1.12

1.07

0.04

74.6

246.3

272.6

299.2

26.5

to_FILE_fmtlib.cpp

2.15

2.08

0.07

128.4

189.6

222.3

254.9

32.7

to_ostream_strf.cpp

1.15

1.10

0.04

74.8

260.9

279.0

301.4

22.3

to_ostream_strf_tr.cpp

1.16

1.11

0.05

75.0

248.2

274.5

296.9

22.4

to_ostream_fmtlib.cpp

1.86

1.79

0.06

109.3

161.2

189.2

217.2

28.0

Static libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.74

0.69

0.04

486.8

617.6

668.4

710.9

42.5

to_charptr_strf_tr.cpp

0.77

0.72

0.04

486.9

599.9

646.6

693.2

46.6

to_charptr_fmtlib_n_c.cpp

1.55

1.48

0.06

564.4

1008.5

1219.7

1422.0

202.3

to_charptr_fmtlib_n.cpp

0.55

0.51

0.03

514.7

557.8

579.4

596.8

17.5

to_charptr_fmtlib_c.cpp

1.20

1.15

0.05

545.9

858.2

1006.1

1166.2

160.1

to_charptr_fmtlib.cpp

0.53

0.49

0.04

514.3

527.9

540.8

545.5

4.7

to_charptr_sprintf.cpp

0.02

0.02

0.00

16.6

21.9

26.7

31.4

4.7

to_string_strf.cpp

0.88

0.84

0.04

494.6

770.7

835.0

907.5

72.5

to_string_strf_tr.cpp

0.96

0.91

0.04

498.8

771.9

873.1

966.0

93.0

to_string_fmtlib_c.cpp

1.68

1.62

0.06

557.2

732.6

815.9

895.1

79.2

to_string_fmtlib.cpp

0.46

0.42

0.03

518.3

555.3

573.8

596.4

22.6

to_FILE_strf.cpp

0.76

0.71

0.04

490.9

626.2

673.1

719.9

46.8

to_FILE_strf_tr.cpp

0.78

0.74

0.04

491.0

604.4

659.4

710.3

50.9

to_FILE_fmtlib.cpp

0.43

0.39

0.03

513.9

523.6

528.4

533.2

4.8

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.6

22.1

26.9

27.7

0.7

to_ostream_strf.cpp

0.81

0.76

0.04

486.6

622.1

672.8

715.4

42.6

to_ostream_strf_tr.cpp

0.86

0.81

0.04

491.2

604.5

659.4

702.0

42.6

to_ostream_fmtlib.cpp

0.54

0.50

0.03

514.5

524.0

532.9

537.6

4.8

Header-only libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.75

1.69

0.06

109.2

491.4

599.7

707.9

108.3

to_charptr_strf_tr.cpp

1.55

1.50

0.05

96.9

208.4

267.3

318.1

50.8

to_charptr_fmtlib_n_c.cpp

2.31

2.23

0.07

105.4

559.7

776.2

974.8

198.7

to_charptr_fmtlib_n.cpp

2.59

2.52

0.07

129.4

202.9

237.6

276.4

38.8

to_charptr_fmtlib_c.cpp

1.98

1.91

0.06

82.9

412.9

565.4

734.4

168.9

to_charptr_fmtlib.cpp

2.57

2.49

0.07

128.8

172.8

198.8

224.9

26.1

to_string_strf.cpp

1.81

1.76

0.05

113.5

657.9

747.4

857.5

110.1

to_string_strf_tr.cpp

1.82

1.76

0.05

114.1

412.3

522.1

619.6

97.5

to_string_fmtlib_c.cpp

2.34

2.27

0.07

113.3

298.2

390.3

478.4

88.0

to_string_fmtlib.cpp

2.93

2.86

0.07

153.8

225.8

265.9

301.9

36.0

to_FILE_strf.cpp

1.75

1.69

0.05

113.5

517.1

617.3

717.6

100.2

to_FILE_strf_tr.cpp

1.59

1.53

0.05

96.9

220.8

275.8

334.8

59.0

to_FILE_fmtlib.cpp

2.94

2.87

0.07

154.5

249.3

300.8

352.3

51.5

to_ostream_strf.cpp

1.77

1.71

0.05

109.7

449.9

546.0

646.1

100.1

to_ostream_strf_tr.cpp

1.64

1.58

0.05

97.2

216.9

271.8

326.6

54.9

to_ostream_fmtlib.cpp

2.56

2.49

0.07

132.6

172.5

198.6

220.5

22.0

Static libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.79

0.73

0.05

1150.0

5879.5

8131.9

10384.1

2252.2

to_charptr_strf_tr.cpp

0.80

0.74

0.05

1169.7

6313.4

8628.1

10950.9

2322.9

to_charptr_fmtlib_n_c.cpp

1.13

1.06

0.06

1286.4

8106.2

10891.8

13667.2

2775.4

to_charptr_fmtlib_n.cpp

0.60

0.55

0.03

806.5

3313.7

4440.8

5571.8

1131.1

to_charptr_fmtlib_c.cpp

1.05

1.00

0.05

1149.3

7471.5

10128.1

12778.6

2650.5

to_charptr_fmtlib.cpp

0.59

0.55

0.03

797.2

3237.1

4333.5

5425.7

1092.2

to_charptr_sprintf.cpp

0.02

0.02

0.00

32.4

209.4

293.8

382.3

88.5

to_string_strf.cpp

0.83

0.78

0.04

1285.1

6497.2

8986.4

11475.5

2489.1

to_string_strf_tr.cpp

0.84

0.79

0.05

1306.0

6957.4

9524.2

12087.0

2562.7

to_string_fmtlib_c.cpp

1.18

1.11

0.06

1214.5

8448.0

11525.7

14597.2

3071.5

to_string_fmtlib.cpp

0.50

0.46

0.03

855.8

3372.0

4500.6

5633.2

1132.7

to_FILE_strf.cpp

0.79

0.74

0.04

1151.9

5896.6

8152.3

10407.8

2255.6

to_FILE_strf_tr.cpp

0.80

0.74

0.05

1171.6

6323.0

8649.2

10971.2

2322.0

to_FILE_fmtlib.cpp

0.48

0.44

0.03

764.2

2968.8

3934.0

4899.3

965.3

to_FILE_fprintf.cpp

0.02

0.02

0.00

32.3

202.8

286.0

369.2

83.2

to_ostream_strf.cpp

0.83

0.78

0.05

1194.8

5910.3

8147.2

10388.0

2240.8

to_ostream_strf_tr.cpp

0.84

0.79

0.05

1214.7

6342.7

8654.0

10961.2

2307.2

to_ostream_fmtlib.cpp

0.60

0.56

0.03

846.1

3360.8

4498.5

5636.2

1137.7

Header-only libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.93

0.87

0.05

835.0

6576.7

9335.3

12089.5

2754.3

to_charptr_strf_tr.cpp

0.94

0.88

0.05

853.7

6991.5

9813.5

12631.3

2817.9

to_charptr_fmtlib_n_c.cpp

1.46

1.38

0.07

1017.6

9279.3

12777.7

16273.4

3495.7

to_charptr_fmtlib_n.cpp

1.34

1.26

0.07

926.8

7768.3

11062.6

14356.9

3294.3

to_charptr_fmtlib_c.cpp

1.38

1.30

0.07

885.0

8629.0

11994.7

15353.1

3358.4

to_charptr_fmtlib.cpp

1.33

1.26

0.07

924.2

7731.0

11008.8

14290.7

3281.9

to_string_strf.cpp

0.97

0.91

0.05

970.8

7207.1

10204.3

13205.5

3001.2

to_string_strf_tr.cpp

0.98

0.92

0.06

994.8

7652.2

10720.1

13787.8

3067.8

to_string_fmtlib_c.cpp

1.44

1.36

0.07

1035.2

9421.3

13066.9

16717.9

3651.0

to_string_fmtlib.cpp

1.46

1.39

0.07

1132.7

8985.0

12785.7

16586.5

3800.8

to_FILE_strf.cpp

0.93

0.88

0.05

837.2

6593.8

9357.5

12117.0

2759.5

to_FILE_strf_tr.cpp

0.94

0.88

0.05

855.9

7009.4

9832.4

12659.5

2827.1

to_FILE_fmtlib.cpp

1.48

1.41

0.07

1107.4

9182.2

13078.6

16970.9

3892.3

to_ostream_strf.cpp

0.98

0.91

0.06

880.1

6608.1

9353.2

12102.2

2749.0

to_ostream_strf_tr.cpp

0.98

0.93

0.05

899.0

7033.6

9838.0

12646.5

2808.4

to_ostream_fmtlib.cpp

1.33

1.26

0.07

964.4

7737.7

11006.9

14272.0

3265.1

GCC 10.2.0

Static libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

0.98

0.93

0.05

489.6

645.6

675.6

701.6

26.0

to_charptr_strf_tr.cpp

0.99

0.93

0.05

489.1

597.8

648.6

695.5

46.8

to_charptr_fmtlib_n_c.cpp

1.48

1.41

0.06

565.0

776.0

822.2

868.3

46.2

to_charptr_fmtlib_n.cpp

0.81

0.75

0.05

525.7

535.2

539.9

548.8

8.8

to_charptr_fmtlib_c.cpp

1.30

1.23

0.06

538.6

614.7

640.1

673.8

33.6

to_charptr_fmtlib.cpp

0.80

0.74

0.05

525.4

534.9

539.6

544.3

4.7

to_charptr_sprintf.cpp

0.02

0.02

0.00

16.6

21.9

26.7

31.4

4.7

to_string_strf.cpp

1.05

0.99

0.05

490.2

641.5

709.5

781.7

72.2

to_string_strf_tr.cpp

1.09

1.03

0.05

490.8

642.6

710.8

779.1

68.3

to_string_fmtlib_c.cpp

1.43

1.37

0.06

527.5

654.1

685.1

716.1

31.0

to_string_fmtlib.cpp

0.68

0.64

0.04

525.0

540.0

549.6

559.2

9.6

to_FILE_strf.cpp

0.99

0.93

0.05

489.4

641.3

671.5

697.5

26.1

to_FILE_strf_tr.cpp

0.99

0.93

0.05

488.9

597.8

648.7

695.7

46.9

to_FILE_fmtlib.cpp

0.66

0.61

0.04

520.7

534.4

535.1

540.0

4.8

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.6

22.1

26.9

27.7

0.7

to_ostream_strf.cpp

1.01

0.96

0.05

489.7

651.5

681.5

707.5

26.0

to_ostream_strf_tr.cpp

1.02

0.96

0.05

489.2

598.0

644.8

695.7

51.0

to_ostream_fmtlib.cpp

0.80

0.75

0.04

525.4

534.9

535.5

540.3

4.8

Header-only libs, with -Os

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.37

1.31

0.06

72.9

292.2

362.1

423.9

61.8

to_charptr_strf_tr.cpp

1.38

1.32

0.05

72.4

253.4

340.1

422.8

82.7

to_charptr_fmtlib_n_c.cpp

1.97

1.90

0.07

90.5

319.8

379.4

439.0

59.6

to_charptr_fmtlib_n.cpp

2.16

2.09

0.07

108.9

174.3

209.0

243.7

34.7

to_charptr_fmtlib_c.cpp

1.79

1.72

0.06

64.7

159.4

198.2

241.2

42.9

to_charptr_fmtlib.cpp

2.15

2.08

0.06

104.5

173.9

208.7

243.4

34.7

to_string_strf.cpp

1.44

1.38

0.06

73.6

301.2

409.1

513.1

104.0

to_string_strf_tr.cpp

1.46

1.40

0.06

74.2

298.1

406.3

514.6

108.3

to_string_fmtlib_c.cpp

1.85

1.78

0.07

76.5

226.5

266.9

307.2

40.3

to_string_fmtlib.cpp

2.40

2.32

0.07

127.1

202.2

241.8

285.5

43.7

to_FILE_strf.cpp

1.37

1.31

0.05

72.8

292.0

357.9

415.7

57.8

to_FILE_strf_tr.cpp

1.38

1.32

0.05

72.3

249.3

340.2

423.0

82.8

to_FILE_fmtlib.cpp

2.42

2.34

0.08

128.3

198.0

232.8

267.7

34.8

to_ostream_strf.cpp

1.40

1.34

0.05

73.1

298.0

363.9

429.8

65.9

to_ostream_strf_tr.cpp

1.40

1.34

0.05

72.6

249.5

336.2

423.1

86.8

to_ostream_fmtlib.cpp

2.15

2.08

0.07

108.5

178.0

208.7

243.5

34.8

Static libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.01

0.96

0.05

488.0

613.3

663.5

705.6

42.0

to_charptr_strf_tr.cpp

1.04

0.98

0.05

492.0

617.6

680.4

747.3

66.9

to_charptr_fmtlib_n_c.cpp

1.79

1.73

0.06

573.5

880.1

1008.1

1178.0

169.9

to_charptr_fmtlib_n.cpp

0.81

0.76

0.05

525.5

564.5

577.9

595.4

17.5

to_charptr_fmtlib_c.cpp

1.47

1.41

0.06

551.3

823.9

960.2

1096.4

136.3

to_charptr_fmtlib.cpp

0.79

0.74

0.05

525.2

538.7

543.4

552.3

8.8

to_charptr_sprintf.cpp

0.02

0.02

0.00

16.6

21.9

26.7

31.4

4.7

to_string_strf.cpp

1.15

1.10

0.05

495.2

704.3

817.0

921.6

104.5

to_string_strf_tr.cpp

1.22

1.16

0.06

495.9

746.9

876.6

998.0

121.4

to_string_fmtlib_c.cpp

1.98

1.91

0.06

562.3

743.5

827.8

916.1

88.4

to_string_fmtlib.cpp

0.69

0.65

0.04

525.0

562.0

584.6

603.1

18.5

to_FILE_strf.cpp

1.02

0.97

0.05

492.1

626.0

668.2

714.5

46.3

to_FILE_strf_tr.cpp

1.05

1.00

0.05

492.1

634.4

709.7

776.7

67.0

to_FILE_fmtlib.cpp

0.66

0.61

0.04

524.8

530.3

535.1

540.0

4.8

to_FILE_fprintf.cpp

0.02

0.01

0.00

16.6

22.1

26.9

27.7

0.7

to_ostream_strf.cpp

1.05

0.99

0.05

492.3

618.1

664.3

710.5

46.2

to_ostream_strf_tr.cpp

1.08

1.03

0.05

492.3

630.3

701.3

772.3

71.0

to_ostream_fmtlib.cpp

0.80

0.75

0.04

525.4

534.9

535.5

540.3

4.8

Header-only libs, with -O3

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

2.04

1.97

0.06

112.9

473.2

585.0

709.0

124.0

to_charptr_strf_tr.cpp

1.86

1.80

0.06

96.4

229.7

296.4

363.0

66.7

to_charptr_fmtlib_n_c.cpp

2.57

2.49

0.07

107.7

436.7

577.9

756.8

178.9

to_charptr_fmtlib_n.cpp

2.87

2.79

0.07

131.9

198.2

233.4

264.5

31.1

to_charptr_fmtlib_c.cpp

2.25

2.17

0.07

81.5

384.5

534.0

679.3

145.3

to_charptr_fmtlib.cpp

2.87

2.80

0.07

127.2

172.2

198.7

221.2

22.5

to_string_strf.cpp

2.12

2.05

0.06

115.3

678.4

936.8

1203.2

266.4

to_string_strf_tr.cpp

2.10

2.03

0.06

109.8

403.8

538.1

688.9

150.8

to_string_fmtlib_c.cpp

2.65

2.58

0.07

107.5

310.9

408.4

509.9

101.5

to_string_fmtlib.cpp

3.29

3.20

0.08

152.5

250.0

302.9

351.7

48.8

to_FILE_strf.cpp

2.02

1.95

0.06

108.7

437.1

545.0

648.7

103.7

to_FILE_strf_tr.cpp

1.91

1.86

0.05

100.6

250.4

329.4

400.3

70.8

to_FILE_fmtlib.cpp

3.30

3.22

0.08

157.5

253.8

301.9

354.2

52.3

to_ostream_strf.cpp

2.03

1.97

0.06

104.9

407.1

506.6

610.3

103.6

to_ostream_strf_tr.cpp

1.95

1.88

0.06

100.8

246.4

317.2

392.0

74.9

to_ostream_fmtlib.cpp

2.87

2.79

0.07

126.4

167.2

189.7

212.2

22.5

Static libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.10

1.03

0.06

1073.2

5209.0

7160.3

9111.7

1951.4

to_charptr_strf_tr.cpp

1.11

1.05

0.06

1099.8

5701.0

7750.6

9800.2

2049.6

to_charptr_fmtlib_n_c.cpp

1.43

1.36

0.07

1208.8

7454.1

9951.5

12442.5

2491.0

to_charptr_fmtlib_n.cpp

0.87

0.82

0.05

722.1

2565.9

3367.9

4161.7

793.8

to_charptr_fmtlib_c.cpp

1.34

1.27

0.06

1064.1

6779.1

9135.3

11488.6

2353.3

to_charptr_fmtlib.cpp

0.86

0.81

0.04

715.9

2473.8

3229.7

3993.8

764.1

to_charptr_sprintf.cpp

0.02

0.02

0.00

32.1

206.8

290.0

373.2

83.2

to_string_strf.cpp

1.15

1.09

0.06

1203.6

5997.4

8277.3

10553.2

2275.9

to_string_strf_tr.cpp

1.16

1.10

0.06

1224.4

6455.0

8809.3

11167.8

2358.5

to_string_fmtlib_c.cpp

1.49

1.41

0.07

1116.2

7813.4

10622.8

13434.1

2811.3

to_string_fmtlib.cpp

0.75

0.70

0.04

752.2

2645.6

3467.5

4289.4

821.9

to_FILE_strf.cpp

1.10

1.04

0.06

1072.3

5189.9

7130.0

9078.3

1948.3

to_FILE_strf_tr.cpp

1.11

1.05

0.05

1098.9

5682.7

7720.9

9763.3

2042.4

to_FILE_fmtlib.cpp

0.72

0.68

0.04

676.5

2151.1

2750.0

3353.0

603.0

to_FILE_fprintf.cpp

0.02

0.02

0.00

32.0

199.8

281.7

367.7

86.0

to_ostream_strf.cpp

1.12

1.06

0.06

1083.3

5198.4

7141.1

9079.7

1938.6

to_ostream_strf_tr.cpp

1.14

1.08

0.05

1110.0

5697.2

7733.9

9770.7

2036.8

to_ostream_fmtlib.cpp

0.87

0.82

0.05

732.5

2589.6

3397.1

4208.7

811.6

Header-only libs, with -g

Source file

Compilation times (s)

Programs size (kB)

Wall

User

Sys

1 file

21 files

31 files

41 files

Difference

to_charptr_strf.cpp

1.24

1.18

0.06

757.1

5909.0

8364.4

10828.0

2463.6

to_charptr_strf_tr.cpp

1.26

1.19

0.07

786.8

6381.8

8932.5

11479.0

2546.6

to_charptr_fmtlib_n_c.cpp

1.79

1.70

0.08

936.0

8631.8

11858.9

15074.9

3216.0

to_charptr_fmtlib_n.cpp

1.65

1.57

0.07

840.4

7119.1

10140.7

13154.1

3013.4

to_charptr_fmtlib_c.cpp

1.70

1.62

0.08

795.9

7947.8

11020.7

14086.1

3065.4

to_charptr_fmtlib.cpp

1.65

1.57

0.07

838.0

7081.3

10082.0

13090.9

3008.9

to_string_strf.cpp

1.30

1.23

0.06

888.2

6706.1

9496.0

12290.1

2794.1

to_string_strf_tr.cpp

1.31

1.24

0.07

908.1

7152.5

10013.8

12875.1

2861.3

to_string_fmtlib_c.cpp

1.77

1.68

0.08

933.6

8789.3

12181.8

15571.1

3389.3

to_string_fmtlib.cpp

1.78

1.69

0.08

1027.1

8366.1

11910.8

15463.6

3552.8

to_FILE_strf.cpp

1.25

1.18

0.06

756.4

5890.0

8340.1

10794.4

2454.2

to_FILE_strf_tr.cpp

1.26

1.19

0.06

782.0

6367.6

8908.8

11450.0

2541.2

to_FILE_fmtlib.cpp

1.81

1.72

0.08

1026.0

8600.3

12251.2

15906.1

3654.9

to_ostream_strf.cpp

1.27

1.20

0.06

767.4

5899.0

8351.9

10796.7

2444.8

to_ostream_strf_tr.cpp

1.28

1.21

0.07

793.2

6382.6

8918.4

11458.3

2539.9

to_ostream_fmtlib.cpp

1.65

1.57

0.07

844.4

7056.3

10043.2

13034.2

2991.0