Subject: Re: [boost] lexical_cast optimization
Date: 2008-12-04 16:57:24
This implementation of itoa is rather fast and open-source, based on a
lookup up table of groups of four digits:
"Fast implementation of the old deprecated itoa(), lltoa() etc... plus
some C++ wrapping. Theoretically controversed but practically very useful."
The source is visible here, with a humble attempt to integrate it into
Thorsten Ottosen wrote:
> Darren Garvey skrev:
>> 2008/12/3 David Abrahams <dave_at_[hidden]>
>>> Someone was asking me today about the inefficiency of lexical_cast for
>>> its common itoa/atoi-like usage, and it occurred to me that it could
>>> *easily* be optimized to handle the common cases by dispatching to
>>> itoa/atoi ftoa/atof where available, and even sprintf. Seems like a
>>> great idea to me.
>> You may find the following interesting:
>> I'd quite like to know if Johan got these changes into the library.
>> Any news
>> on this?
> I haven't looked at the implementation, but I know Matthew Wilson had
> a series of articles in CUJ about fast string to integer conversions.
> IIRC, he was doing much better than the functions from the C library:
> I guess it might be possible to optimize the floating point casts too,
> albeit it might be somewhat harder.
> Unsubscribe & other changes:
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk