|
This page presents the results of seven scenarios, conducted on GCC and
Visual C++ compilers on 32-bit and 64-bit Linux and Windows systems, using
the
FastFormat 0.2.1 beta 6 distribution.
The results are presented as times relative to the performance of the
FastFormat.Format
API. The libraries tested are:
-
C's standard Streams library, comprising the
printf() -family of
functions
-
C++'s standard IOStreams library
-
Boost's Boost.Format library
-
Loki's SafeFormat library
-
FastFormat's FastFormat.Write API
Each entry in the table whose value is >1.0 is a case where
FastFormat.Format has a superior performance to the given
library. Each entry where the value is <1.0 is a case where
FastFormat.Format has an inferior performance to the given
library.
For example, in Scenario 1, the average relative performance
of Boost.Format is 10.29, indicating that FastFormat.Format
is approximately 10 times (~900%) faster than Boost.Format. And
in Scenario 2, the average relative performance of C's
Streams is 0.83, indicating that FastFormat.Format
is approximately 17% slower than Streams.
The details of each scenario can be obtained by clicking on the
scenario in the table. All the times were obtained from building the
test.performance make target available in the
FastFormat 0.2.1 beta 6 distribution.
(Note: to compare with Boost and Loki, you must ensure that
the environment variables BOOST and LOKI
are set and available, i.e. "make -e test.performance" )
Results:
Scenario |
Operating System / Architecture |
Compiler |
library (performance relative to that of FastFormat.Format) |
Streams (snprintf() ) |
IOStreams |
Boost.Format |
Loki.SafeFormat |
FastFormat.Write |
Scenario 1 |
Ubuntu (x86) |
GCC 4.2 |
0.92 | 1.93 | 6.32 | 1.69 | 0.50 |
Ubuntu (x64) |
GCC 4.1 |
0.84 | 1.58 | 6.46 | 2.07 | 0.67 |
Windows (x86) |
Visual C++ 6 |
1.78 | 3.43 | 11.52 | | 0.73 |
Windows (x86) |
Visual C++ 9 |
1.84 | 5.22 | 14.47 | 2.59 | 0.84 |
Windows (x64) |
Visual C++ 9 |
2.10 | 4.23 | 12.70 | 2.75 | 0.95 |
min (worst FastFormat) |
|
0.84 | 1.58 | 6.32 | 1.69 | 0.50 |
max (best FastFormat) |
|
2.10 | 5.22 | 14.47 | 2.75 | 0.95 |
avg |
|
1.49 | 3.28 | 10.29 | 2.28 | 0.74 |
Scenario 2 |
Ubuntu (x86) |
GCC 4.2 |
0.62 | 1.51 | 3.88 | 1.14 | 0.69 |
Ubuntu (x64) |
GCC 4.1 |
0.75 | 2.01 | 5.63 | 1.68 | 0.84 |
Windows (x86) |
Visual C++ 6 |
1.01 | 2.06 | 4.78 | | 0.90 |
Windows (x86) |
Visual C++ 9 |
0.79 | 2.64 | 5.62 | 1.22 | 0.84 |
Windows (x64) |
Visual C++ 9 |
0.97 | 2.58 | 6.00 | 1.40 | 0.93 |
min (worst FastFormat) |
|
0.62 | 1.51 | 3.88 | 1.14 | 0.69 |
max (best FastFormat) |
|
1.01 | 2.64 | 6.00 | 1.68 | 0.93 |
avg |
|
0.83 | 2.16 | 5.18 | 1.36 | 0.84 |
Scenario 3 |
Ubuntu (x86) |
GCC 4.2 |
1.67 | 2.68 | 5.86 | 3.01 | 0.69 |
Ubuntu (x64) |
GCC 4.1 |
0.91 | 2.58 | 4.93 | 1.51 | 0.69 |
Windows (x86) |
Visual C++ 6 |
0.95 | 3.82 | 8.46 | | 0.59 |
Windows (x86) |
Visual C++ 9 |
1.37 | 9.86 | 23.78 | 1.86 | 0.56 |
Windows (x64) |
Visual C++ 9 |
0.87 | 6.45 | 17.46 | 1.74 | 0.50 |
min (worst FastFormat) |
|
0.87 | 2.58 | 4.93 | 1.51 | 0.50 |
max (best FastFormat) |
|
1.67 | 9.86 | 23.78 | 3.01 | 0.69 |
avg |
|
1.15 | 5.08 | 12.10 | 2.03 | 0.61 |
Scenario 4 |
Ubuntu (x86) |
GCC 4.2 |
0.62 | 1.85 | 3.89 | 2.20 | 0.80 |
Ubuntu (x64) |
GCC 4.1 |
0.67 | 2.01 | 4.05 | 1.67 | 0.80 |
Windows (x86) |
Visual C++ 6 |
0.72 | 1.88 | 4.90 | | 0.80 |
Windows (x86) |
Visual C++ 9 |
0.64 | 3.59 | 8.15 | 0.79 | 0.84 |
Windows (x64) |
Visual C++ 9 |
0.64 | 2.70 | 6.88 | 0.72 | 0.83 |
min (worst FastFormat) |
|
0.62 | 1.85 | 3.89 | 0.72 | 0.80 |
max (best FastFormat) |
|
0.72 | 3.59 | 8.15 | 2.20 | 0.84 |
avg |
|
0.66 | 2.41 | 5.57 | 1.35 | 0.81 |
Scenario 5 |
Ubuntu (x86) |
GCC 4.2 |
0.63 | 1.25 | 5.65 | 1.37 | 0.48 |
Ubuntu (x64) |
GCC 4.1 |
0.86 | 1.39 | 5.33 | 1.71 | 0.54 |
Windows (x86) |
Visual C++ 6 |
2.01 | 2.61 | 9.95 | | 0.69 |
Windows (x86) |
Visual C++ 9 |
2.90 | 5.99 | 16.71 | 3.80 | 0.84 |
Windows (x64) |
Visual C++ 9 |
1.76 | 2.86 | 5.77 | 1.79 | 0.96 |
min (worst FastFormat) |
|
0.63 | 1.25 | 5.33 | 1.37 | 0.48 |
max (best FastFormat) |
|
2.90 | 5.99 | 16.71 | 3.80 | 0.96 |
avg |
|
1.63 | 2.82 | 8.68 | 2.17 | 0.70 |
Scenario 6 |
Ubuntu (x86) |
GCC 4.2 |
2.82 | 2.10 | 12.34 | 4.87 | 0.67 |
Ubuntu (x64) |
GCC 4.1 |
1.41 | 1.80 | 8.94 | 3.18 | 0.84 |
Windows (x86) |
Visual C++ 6 |
9.85 | 17.71 | 13.73 | | 0.90 |
Windows (x86) |
Visual C++ 9 |
9.33 | 13.84 | 28.43 | 5.85 | 0.97 |
Windows (x64) |
Visual C++ 9 |
10.92 | 14.37 | 22.94 | 7.98 | 0.99 |
min (worst FastFormat) |
|
1.41 | 1.80 | 8.94 | 3.18 | 0.67 |
max (best FastFormat) |
|
10.92 | 17.71 | 28.43 | 7.98 | 0.99 |
avg |
|
6.87 | 9.96 | 17.27 | 5.47 | 0.88 |
Scenario 7 |
Ubuntu (x86) |
GCC 4.2 |
0.62 | 1.78 | 5.42 | 1.45 | 0.45 |
Ubuntu (x64) |
GCC 4.1 |
0.81 | 1.27 | 5.22 | 1.92 | 0.55 |
Windows (x86) |
Visual C++ 6 |
2.08 | 3.27 | 10.94 | | 0.72 |
Windows (x86) |
Visual C++ 9 |
2.69 | 5.56 | 16.24 | 3.38 | 0.91 |
Windows (x64) |
Visual C++ 9 |
2.01 | 2.43 | 6.86 | 1.88 | 0.91 |
min (worst FastFormat) |
|
0.62 | 1.27 | 5.22 | 1.45 | 0.45 |
max (best FastFormat) |
|
2.69 | 5.56 | 16.24 | 3.38 | 0.91 |
avg |
|
1.64 | 2.86 | 8.94 | 2.16 | 0.71 |
The results illustrate the clear performance advantages of
FastFormat's APIs:
-
Streams: FastFormat.Format is faster than Streams, by between
15-580%, in all cases except for
Scenario 2
and
Scenario 4,
where it is 17% and 34% slower, respectively
-
IOStreams: FastFormat.Format is faster than IOStreams, by between
~100-900%, in all cases
-
Boost.Format: FastFormat.Format is faster than Boost.Format, by between
~400-1650%, in all cases
-
Loki.SafeFormat: FastFormat.Format is faster than Loki.SafeFormat, by between
~35-450%, in all cases
-
FastFormat.Write: FastFormat.Format is slower than FastFormat.Write, by ~25%,
in all cases. This makes FastFormat.Write faster than all competitors, including Streams,
except for
Scenario 2
and
Scenario 4.
|