bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: API pair_content() call is about 7x slower on Fedora 29 vs Bionic


From: Bryan Christ
Subject: Re: API pair_content() call is about 7x slower on Fedora 29 vs Bionic
Date: Fri, 28 Dec 2018 10:53:04 -0600

Thomas,

Attached are the callgrind logs.  I'm using kcachegrind to interpret the output. As far as I can tell, when my I leave my default callback in
place (a wrapper for pair_content) pair_content becomes the top offender
(log 3135).  When I install my replacement for pair_content performance
becomes really good (log 4116).

My replacement callback is called vshell_pair_splitter() and you can see
that by contrast, it barely shows up on the radar:

int
vshell_pair_splitter(vterm_t *vterm, short pair, short *fg, short *bg)
{
    extern int      color_count;    // always 8 colors

    (void)vterm;    // make compiler happy

    if(pair == 0)
    {
        *fg = COLOR_WHITE;
        *bg = COLOR_BLACK;

        return 0;
    }

    *bg = (int)(pair / color_count);
    *fg = (color_count - pair) - (pair % color_count);

    return 0;
}



On Fri, Dec 28, 2018 at 9:48 AM Pavel Stehule <address@hidden> wrote:


pá 28. 12. 2018 v 14:18 odesílatel Thomas Dickey <address@hidden> napsal:
On Fri, Dec 28, 2018 at 06:32:18AM +0100, Pavel Stehule wrote:
> Hi
>
> pá 28. 12. 2018 v 3:27 odesílatel Thomas Dickey <address@hidden> napsal:
>
> > On Thu, Dec 27, 2018 at 07:09:09PM -0600, Bryan Christ wrote:
> > > I was testing the performance of pair_content() 2 different ways.
> > >
> > > 1.  The very unscientific, observation that "pspg" (a db pager) was
> > > scrolling
> >
> > https://github.com/okbob/pspg
> >
> > > very slowly horizontally when testing my emulator on F29 but not on Bionic.
> > > 2.  I placed both instances under callgrind which surfaced pair_content() as
> > > being quite consuming on F29 but not Bionic.
...
> > Bionic has the _source_ for ncurses 6.1, but uses ABI 5 (pre-2015).
> > Offhand, with ABI 6 you'll use more memory but for the same calls,
> > probably get roughly the same performance.  A small benchmark
> > would prove that one way or the other :-)

With the given information, I setup a test to get profiling information
to compare (on the same machine) ABI 5 and 6.  But I suppose I need more
information, since I'm not seeing a marked difference in performance.

With (TERM=xterm-256color)

        pspg -f pg_class.txt

and pressing the right-arrow 15 times, there's actually not a lot of
CPU time involved.  Attaching the gprof listing for ABI 6

pspg pair_content doesn't use - the problem was in Bryan's ncurses terminal https://github.com/TragicWarrior/libvterm/commits/master (release 4.7 and older) when pspg was executed from this terminal.

Regards

Pavel
 

--
Thomas E. Dickey <address@hidden>
https://invisible-island.net
ftp://ftp.invisible-island.net


--
Bryan
<><

Attachment: callgrind.out.3135
Description: Binary data

Attachment: callgrind.out.4116
Description: Binary data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]