[Top][All Lists]

[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: Thomas Dickey
Subject: Re: API pair_content() call is about 7x slower on Fedora 29 vs Bionic
Date: Sat, 29 Dec 2018 06:45:53 -0500
User-agent: Mutt/1.5.23 (2014-03-12)

On Fri, Dec 28, 2018 at 11:05:20AM -0600, Bryan Christ wrote:
> Thomas,
> Here's another callgrind log.  This one is from Bionic with the default
> callback
> installed (the wrapper for pair_content).  You can see that pair_content()
> does show
> up, but it's several times less impactful than the same scenario on F29.

thanks.  I see that you also checked in the code which calls pair_content,
and will make a benchmark to help with the discussion.  I can see some
area for improvement in ncurses (benchmark will show how much), but the
linear lookup of color pairs which you're doing is the main problem:

        a) if a pair is not initialized, you don't get much benefit from
           asking about it, since it has predefined (useless..) content.
        b) linear searches are _slow_, even for 512 elements.

Since your emulator captures all of the color information, it probably
would be better to limit the loop to the number of pairs actually
used, as well as to use tsearch to lookup the color information (using
your own cache).

I'll followup once I've done the benchmark/improvements.

Thomas E. Dickey <address@hidden>

Attachment: signature.asc
Description: Digital signature

reply via email to

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