Skip to content

Performance regression on integer formatting #186

Closed
@vitaut

Description

@vitaut

fmt::format performance on integer formatting is down to sprintf level. Need to investigate and fix before 2.0.

['Method'                      , 'Time, s' , 'Time ratio' ],
['fmt::FormatInt'              ,   0.130368,           1.0],
['cppx::decimal_from'          ,   0.160879, 1.23403749386],
['karma::generate'             ,   0.163209, 1.25190997791],
['fmt::Writer'                 ,   0.201434, 1.54511843397],
['karma::generate+std::string' ,   0.319312, 2.44931271478],
['fmt::Writer+std::string'     ,   0.369383, 2.83338702749],
['ltoa'                        ,   0.487947, 3.74284333579],
['itostr'                      ,    0.62576,  4.7999509082],
['sprintf'                     ,   0.887256, 6.80578055965],
['boost::lexical_cast'         ,   0.952595, 7.30696950172],
['fmt::format'                 ,   0.995007,  7.6322947349],
['sprintf+std::string'         ,    1.04289, 7.99958578792],
['std::stringstream'           ,    1.25203, 9.60381381934],
['std::to_string'              ,    1.38192, 10.6001472754],
['boost::format'               ,    4.40774, 33.8099840452]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions