[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: Re: How to extract a floating point number locale-independantly
- From: Daurnimator <quae@...>
- Date: Fri, 29 Apr 2016 14:33:41 +1000
On 29 April 2016 at 05:13, Roberto Ierusalimschy <roberto@inf.puc-rio.br> wrote:
>> > - If running in a locale where '.' is not the decimal separator,
>> > parsing lua could result in *many* calls to `localeconv`.
>>
>> I am not sure what you count as "many", but the code seems to call
>> `localeconv` once per chunk (unless you change locales during
>> parsing, in which case is plus one per change).
>
> A curiosity: is there any special reason to believe that 'localeconv'
> is slow?
Not particularly.
I just checked how it's implemented in various libcs, and it's usually
either just returning the same pointer, or several copies into a
static buffer.