- The Format API is faster than IOStreams by between ~140-730%, faster than MFC's
CString::Format()by between ~300-400%, and faster than Boost.Format by between ~470-1600%! The only formatting API that gives it a run for some architecture/compiler/configurations issprintf(), which is not type-safe, at between ~40-380%. (FastFormat's Format API is 100% type-safe.) - The simpler Write API is faster than IOStreams by between ~270-1350%, faster than MFC's
CString::Format()by around ~420%, and faster than Boost.Format by between ~630-1800%! Again, the only formatting API that gives it a run for some architecture/compiler/configurations issprintf(), at between ~65-390%. (FastFormat's Write API is 100% type-safe.)
Musings of an STL-extension library designer (who's renowned for producing high-quality software with low-quality documentation).
Showing posts with label performance. Show all posts
Showing posts with label performance. Show all posts
Wednesday, September 10, 2008
FastFormat is FAST: It's official!
I just posted some performance stats on the FastFormat website. I'll just give you the summary here:
Monday, September 1, 2008
FastFormat about to drop ... and it's FAST!
I'm now less than two days away from releasing FastFormat. All that's left to do is:
std::string arg0 = "abc";
const char arg1[] = "def";
stlsoft::simple_string arg2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
fastformat::fmt(s, "The first param '{0}', and the second '{1}', and the first again '{0}'. Finally the third '{2}'", arg0, arg1, arg2);
Note: this is for one compiler (VC++ 9), and one scenario (described above), so we can't draw any way-out conclusions as yet. But the first results are pretty encouraging to say the least:
IOStreams: 679561us
Boost.Format: 1901109us
sprintf(): 346776us
FastFormat: 112016us
IOStreams:FastFormat: 6.067
Boost.Format:FastFormat: 16.97
sprintf:FastFormat(): 3.096
These numbers mean that, for that scenario with that compiler, FastFormat is 3x faster than sprintf, 6x faster than the IOStreams, and 17x than Boost.Format.
Given that it's 100% type-safe, infinitely extensible, and supports I18N/L10N, I hope that it's going to be well received.
- verify on 64-bit Linux
- do the docs (a basic first cut; nothing mega good)
- try and find out why DMC++ does not like it (as usual, it's the odd-man-out with templates)
- do a decently comprehensive lot of performance tests
std::string arg0 = "abc";
const char arg1[] = "def";
stlsoft::simple_string arg2 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
fastformat::fmt(s, "The first param '{0}', and the second '{1}', and the first again '{0}'. Finally the third '{2}'", arg0, arg1, arg2);
Note: this is for one compiler (VC++ 9), and one scenario (described above), so we can't draw any way-out conclusions as yet. But the first results are pretty encouraging to say the least:
IOStreams: 679561us
Boost.Format: 1901109us
sprintf(): 346776us
FastFormat: 112016us
IOStreams:FastFormat: 6.067
Boost.Format:FastFormat: 16.97
sprintf:FastFormat(): 3.096
These numbers mean that, for that scenario with that compiler, FastFormat is 3x faster than sprintf, 6x faster than the IOStreams, and 17x than Boost.Format.
Given that it's 100% type-safe, infinitely extensible, and supports I18N/L10N, I hope that it's going to be well received.
Subscribe to:
Posts (Atom)