https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98076

--- Comment #9 from Francois-Xavier Coudert <fxcoudert at gcc dot gnu.org> ---
After my patch, measurements seem to indicate the output of integers is mostly
bound the library overhead. Inspection of the various itoa/btoa/otoa/xtoa
functions seems to show they're reasonably efficient.

Reading of integers is still quite inefficient. The function read_decimal()
always works with the largest integer kind, performing additions and
multiplications by 10. This is, I think, available in hardware (not library
call).

read_radix() is probably also quite inefficient. It is written in a completely
generic fashion, although it operates on fixed radices (2, 8 or 16); such
multiplications could be done by bit shift. Even if we told the compilers that
the radix was 2, 8 or 16 in each case (three functions), it would optimise the
multiplications into bit shifts itself.

Reply via email to