This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Fix slow and non-deterministic behavior of isspace() and tolower()


On Sun, Jun 9, 2019 at 10:42 AM Eli Zaretskii <eliz@gnu.org> wrote:
>
> > From: Shawn Landden <shawn@git.icu>
> > Cc: Shawn Landden <shawn@git.icu>
> > Date: Sun,  9 Jun 2019 10:17:04 -0500
> >
> > I was getting 8% and 6% cpu usage in tolower() and isspace(),
> > respectively, waiting for a breakpoint on ppc64el.
> >
> > Also, gdb doesn't want non-deterministic behavior here.
>
> Instead of inventing our own wheel, how about using the Gnulib's
> c-ctype module?
The tolower() really should only apply to languages that need it, like Ada.
It is kinda a bug to use it with C, which is case sensitive. Also we
probably don't need
the full isspace() either, and these are simple functions. I think it
is much better to be able to
see the full algorithm right in front of you. (even if I just did the
base minimum to speed this up,
without having to study it).

-Shawn Landden


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]