June 13, 2011

Challenge: Fastest ‘atoi’ Implementation

Filed under: Technical — Tags: , — James Bunton @ 6:22 pm

At work recently I was writing some code that needs to parse very large input files consisting of decimal numbers. These need to be converted to binary. My first attempt at doing this with boost::lexical_cast() was laughably slow, so I did some experiments to see how fast I could get it.