[m-rev.] for review: speed up uint32 to string conversion
Julien Fischer
jfischer at opturion.com
Wed Oct 27 21:56:35 AEDT 2021
On Wed, 27 Oct 2021, Zoltan Somogyi wrote:
> On Wed, 27 Oct 2021 19:53:11 +1100 (AEDT), Julien Fischer <jfischer at opturion.com> wrote:
>> That said, I think the immediate concern should be to replace calls to
>> sprintf() where possible.
>
> Agreed, but it should be done in two phases. First, find the best replacement,
> and then, roll it out to all related conversion functions, not just
> the one for uint32s.
I was intending to do this for all integer types, not just uint32s.
(I started with uints32s because it made comparison with the non-C
grades easier.)
> The best approach *may* differ between e.g. uintN for different N,
> but probably not by much.
I suspect there may be some difference between the 32-bit and 64-bit
cases and that the other cases can be handled by casting and then
calling the 32-bit or 64-bit case appropriate.
Unless you have any objections I will commit this diff and then add
additional benchmarks and tests for the other integer types.
Julien.
More information about the reviews
mailing list