|Subject:||Re: API pair_content() call is about 7x slower on Fedora 29 vs Bionic|
|Date:||Sat, 29 Dec 2018 09:48:01 -0600|
On Fri, Dec 28, 2018 at 11:05:20AM -0600, Bryan Christ wrote:
> Here's another callgrind log. This one is from Bionic with the default
> 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>
|[Prev in Thread]||Current Thread||[Next in Thread]|