public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "fxcoudert at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libfortran/98076] Increase speed of integer I/O
Date: Sun, 26 Dec 2021 11:14:33 +0000	[thread overview]
Message-ID: <bug-98076-4-HDN96RHZ89@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-98076-4@http.gcc.gnu.org/bugzilla/>

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.

  parent reply	other threads:[~2021-12-26 11:14 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01  6:49 [Bug libfortran/98076] New: " tkoenig at gcc dot gnu.org
2020-12-01  6:50 ` [Bug libfortran/98076] " tkoenig at gcc dot gnu.org
2021-04-16 16:22 ` tkoenig at gcc dot gnu.org
2021-04-27 11:39 ` jakub at gcc dot gnu.org
2021-07-28  7:05 ` rguenth at gcc dot gnu.org
2021-07-29 19:18 ` anlauf at gcc dot gnu.org
2021-12-16 21:31 ` fxcoudert at gcc dot gnu.org
2021-12-16 21:40 ` fxcoudert at gcc dot gnu.org
2021-12-16 23:20 ` fxcoudert at gcc dot gnu.org
2021-12-17  9:05 ` fxcoudert at gcc dot gnu.org
2021-12-25 13:04 ` fxcoudert at gcc dot gnu.org
2021-12-26 11:14 ` fxcoudert at gcc dot gnu.org [this message]
2021-12-27 20:13 ` ro at gcc dot gnu.org
2021-12-27 20:25 ` fxcoudert at gcc dot gnu.org
2021-12-27 21:59 ` ro at CeBiTec dot Uni-Bielefeld.DE

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98076-4-HDN96RHZ89@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).