Re: refactoring - share str2*int64 functions - Mailing list pgsql-hackers

From Andres Freund
Subject Re: refactoring - share str2*int64 functions
Date
Msg-id 20191004152808.hm6qdvbdnpe4ieom@alap3.anarazel.de
Whole thread Raw
In response to Re: refactoring - share str2*int64 functions  (Ashutosh Sharma <ashu.coek88@gmail.com>)
Responses Re: refactoring - share str2*int64 functions
List pgsql-hackers
Hi,

On 2019-10-04 14:27:44 +0530, Ashutosh Sharma wrote:
> Is there any specific reason for hard coding the *base* of a number
> representing the string in strtouint64(). I understand that currently
> strtouint64() is being used just to convert an input string to decimal
> unsigned value but what if we want it to be used for hexadecimal
> values or may be some other values, in that case it can't be used.

It's a lot slower if the base is variable, because the compiler cannot
replace the division by shifts.

Greetings,

Andres Freund



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Proposal: Make use of C99 designated initialisers for nulls/values arrays
Next
From: Jacob Champion
Date:
Subject: Re: Proposal: Make use of C99 designated initialisers fornulls/values arrays