FastFormat - Performance

Links
Home
Download
SourceForge Project Website
Blog
Documentation
Help Forum
Request FastFormat training
Donate
Performance
Memory Guessing Game
STLSoft
Pantheios
 

Ultimate robustness!

  • 100% type-safe

Unlimited flexibility!

  • infinitely extensible

Unbeatable performance!

  • 5 - 17 times faster than Boost.Format
  • 1.5 - 5.5 times faster than Loki.SafeFormat

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.921.936.321.690.50
Ubuntu (x64) GCC 4.1 0.841.586.462.070.67
Windows (x86) Visual C++ 6 1.783.4311.52 0.73
Windows (x86) Visual C++ 9 1.845.2214.472.590.84
Windows (x64) Visual C++ 9 2.104.2312.702.750.95
min (worst FastFormat)   0.841.586.321.690.50
max (best FastFormat)   2.105.2214.472.750.95
avg   1.493.2810.292.280.74
Scenario 2 Ubuntu (x86) GCC 4.2 0.621.513.881.140.69
Ubuntu (x64) GCC 4.1 0.752.015.631.680.84
Windows (x86) Visual C++ 6 1.012.064.78 0.90
Windows (x86) Visual C++ 9 0.792.645.621.220.84
Windows (x64) Visual C++ 9 0.972.586.001.400.93
min (worst FastFormat)   0.621.513.881.140.69
max (best FastFormat)   1.012.646.001.680.93
avg   0.832.165.181.360.84
Scenario 3 Ubuntu (x86) GCC 4.2 1.672.685.863.010.69
Ubuntu (x64) GCC 4.1 0.912.584.931.510.69
Windows (x86) Visual C++ 6 0.953.82 8.46   0.59
Windows (x86) Visual C++ 9 1.379.8623.781.860.56
Windows (x64) Visual C++ 9 0.876.4517.461.740.50
min (worst FastFormat)   0.872.584.931.510.50
max (best FastFormat)   1.679.8623.783.010.69
avg   1.155.0812.102.030.61
Scenario 4 Ubuntu (x86) GCC 4.2 0.621.853.892.200.80
Ubuntu (x64) GCC 4.1 0.672.014.051.670.80
Windows (x86) Visual C++ 6 0.721.884.90  0.80
Windows (x86) Visual C++ 9 0.643.598.150.790.84
Windows (x64) Visual C++ 9 0.642.706.880.720.83
min (worst FastFormat)   0.621.853.890.720.80
max (best FastFormat)   0.723.598.152.200.84
avg   0.662.415.571.350.81
Scenario 5 Ubuntu (x86) GCC 4.2 0.631.255.651.370.48
Ubuntu (x64) GCC 4.1 0.861.395.331.710.54
Windows (x86) Visual C++ 6 2.012.619.95   0.69
Windows (x86) Visual C++ 9 2.905.9916.713.800.84
Windows (x64) Visual C++ 9 1.762.865.771.790.96
min (worst FastFormat)   0.631.255.331.370.48
max (best FastFormat)   2.905.9916.713.800.96
avg   1.632.828.682.170.70
Scenario 6 Ubuntu (x86) GCC 4.2 2.822.1012.344.870.67
Ubuntu (x64) GCC 4.1 1.411.808.943.180.84
Windows (x86) Visual C++ 6 9.85 17.7113.73  0.90
Windows (x86) Visual C++ 9 9.3313.8428.435.850.97
Windows (x64) Visual C++ 9 10.9214.3722.947.980.99
min (worst FastFormat)   1.411.808.943.180.67
max (best FastFormat)   10.9217.7128.437.980.99
avg   6.879.9617.275.470.88
Scenario 7 Ubuntu (x86) GCC 4.2 0.621.785.421.450.45
Ubuntu (x64) GCC 4.1 0.811.275.221.920.55
Windows (x86) Visual C++ 6 2.083.2710.94  0.72
Windows (x86) Visual C++ 9 2.695.5616.243.380.91
Windows (x64) Visual C++ 9 2.012.436.861.880.91
min (worst FastFormat)   0.621.275.221.450.45
max (best FastFormat)   2.695.5616.243.380.91
avg   1.642.868.942.160.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.

Support This Project      Valid XHTML 1.0 Transitional