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:
  • 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
As a first go at verifying the performance, I've run a test which formats thusly:

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.

No comments: