This scenario comprises the following FastFormat code, and functional equivalents for all other libraries examined:
struct person_t
{
char const* name;
int age;
float height;
};
static const person_t args[] =
{
{ "Shrek", 6, 1.99f }
, { "Batman", 65, 1.87f }
, { "Simon", 40, 1.86f }
, { "Farman", 40, 1.84f }
, { "Marmaduke, Third Lord of the Fleet, Justice of the Provinces, and Emperor of his own back garden", 101, 1.20f }
};
{ for(unsigned i = 0; i < ITERATIONS; ++i)
{
{ for(unsigned k = 0; k != STLSOFT_NUM_ELEMENTS(args); ++k)
{
std::string sink;
fastformat::fmt(sink, "{0}, {1}, {2}"
, args[k].name, args[k].age, args[k].height);
}}
}}
This is the
test/performance/performance.test.name_age_height
performance test included in the
FastFormat 0.2.1 beta 6 distribution.
|
|
|