Update benchmark results.

This commit is contained in:
Victor Zverovich 2014-05-22 06:08:50 -07:00
parent 3e4eded5b2
commit f561a7b0e8

View File

@ -260,45 +260,45 @@ Performance of format is close to that of printf.
Compile time and code bloat Compile time and code bloat
~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~
The script `bloat_test.sh The script `bloat_test.py
<https://github.com/cppformat/format-benchmark/blob/master/bloat_test.sh>`__ <https://github.com/cppformat/format-benchmark/blob/master/bloat-test.py>`__
from `tinyformat <https://github.com/c42f/tinyformat>`__ tests compile time from `format-benchmark <https://github.com/cppformat/format-benchmark>`__
and code bloat for nontrivial projects. It generates 100 translation units tests compile time and code bloat for nontrivial projects.
and uses ``printf()`` or its alternative five times in each to simulate It generates 100 translation units and uses ``printf()`` or its alternative
a medium sized project. The resulting executable size and compile time five times in each to simulate a medium sized project. The resulting
(g++-4.7.2, Ubuntu GNU/Linux 12.10, best of three) is shown in the following executable size and compile time (g++-4.8.1, Ubuntu GNU/Linux 13.10,
tables. best of three) is shown in the following tables.
**Non-optimized build**
====================== ================== ==========================
test name total compile time executable size (stripped)
====================== ================== ==========================
libc printf 2.8s 44K (32K)
std::ostream 12.9s 84K (60K)
format 16.0s 152K (128K)
tinyformat 20.6s 240K (200K)
boost::format 76.0s 888K (780K)
====================== ================== ==========================
**Optimized build (-O3)** **Optimized build (-O3)**
====================== ================== ========================== ====================== ================== ==========================
test name total compile time executable size (stripped) test name total compile time executable size (stripped)
====================== ================== ========================== ====================== ================== ==========================
libc printf 3.5s 40K (28K) libc printf 2.5 42K (31K)
std::ostream 14.1s 88K (64K) IOStreams 19.8 86K (64K)
format 25.1s 552K (536K) C++ Format 48.8 103K (84K)
tinyformat 56.3s 200K (164K) tinyformat 65.0 428K (396K)
boost::format 169.4s 1.7M (1.6M) Boost Format 212.0 1014K (945K)
====================== ================== ========================== ====================== ================== ==========================
Printf and std::ostream win here which is not surprising considering **Non-optimized build**
that they are included in the standard library. Tinyformat has somewhat
slower compilation times compared to format. Interestingly optimized ====================== ================== ==========================
executable size is smaller with tinyformat then with format and for test name total compile time executable size (stripped)
non-optimized build its the other way around. Boost::format has by far ====================== ================== ==========================
the largest overheads. libc printf 2.1s 42K (31K)
IOStreams 17.3s 84K (60K)
C++ Format 42.7s 167K (138K)
tinyformat 25.1s 239K (195K)
Boost Format 110.2s 905K (781K)
====================== ================== ==========================
IOStreams and printf win here which is not surprising considering that
they are included in the standard library. Tinyformat produces somewhat
larger executable sizes compared to C++ Format. Interestingly optimized
compile time is smaller for C++ Format than for tinyformat and its the
other way around with non-optimized build. Boost Format has by far the
largest overheads.
Running the tests Running the tests
~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~